/* ScoutPoint Capital — design "Navy Mesh" (v2)
   White ground, deep navy type, one accent. Shared by home, login, forum. */

:root {
  --navy: #081c36;
  --navy-60: rgba(8, 28, 54, 0.6);
  --navy-30: rgba(8, 28, 54, 0.3);
  --navy-12: rgba(8, 28, 54, 0.12);
  --navy-05: rgba(8, 28, 54, 0.05);
  --blue: #1554a0;
  --white: #ffffff;
  --max: 1000px;
  --sans: "Inter", -apple-system, system-ui, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: var(--white);
  color: var(--navy);
  font-family: var(--sans);
  font-size: 16.5px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--blue); }

/* ---------- Top bar ---------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.3rem 1.5rem;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--navy);
  text-decoration: none;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.01em;
}

.wordmark .mark { width: 24px; height: 24px; }

/* Custom logo lockup swapped in by brand.js — sized to be legible. */
.wordmark.has-logo { gap: 0; }
.brand-logo { display: block; height: 44px; width: auto; }
.side .brand-logo { height: 40px; }
body.home .brand-logo { height: 62px; }
@media (max-width: 720px) {
  .brand-logo { height: 34px; }
  body.home .brand-logo { height: 44px; }
}

/* Home top-bar nav */
.home-nav { display: flex; align-items: center; gap: 1.5rem; }

.nav-link {
  color: var(--navy);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
}

.nav-link:hover { color: var(--blue); }

.btn {
  display: inline-block;
  padding: 0.6rem 1.25rem;
  border-radius: 8px;
  background: var(--navy);
  color: var(--white);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  border: 1px solid var(--navy);
  cursor: pointer;
  font-family: var(--sans);
  transition: opacity 150ms ease;
}

.btn:hover { opacity: 0.85; }

.btn-outline { background: transparent; color: var(--navy); }
.btn-outline:hover { background: var(--navy-05); opacity: 1; }

/* ---------- Home ---------- */

.hero {
  position: relative;
  max-width: var(--max);
  margin: 0 auto;
  padding: 5rem 1.5rem 4rem;
  min-height: 62vh;
  display: flex;
  align-items: center;
}

#mesh {
  position: absolute;
  inset: 0;
  left: 38%;
  width: 62%;
  height: 100%;
}

.hero-copy { position: relative; max-width: 30rem; }

.hero-copy h1 {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
}

.hero-copy p {
  margin-top: 1.25rem;
  font-size: 1.15rem;
  color: var(--navy-60);
}

.what {
  max-width: var(--max);
  margin: 0 auto;
  padding: 4rem 1.5rem 5rem;
  border-top: 1px solid var(--navy-12);
}

/* ---------- Focus / viewfinder motif ---------- */

.focus-frame {
  position: relative;
  max-width: 40rem;
  padding: 2.5rem 2.75rem;
}

.fcorner {
  position: absolute;
  width: 30px;
  height: 30px;
  border: 3px solid var(--navy);
  opacity: 0;
  pointer-events: none;
}

.f-tl { top: 0; left: 0; border-right: none; border-bottom: none; transform: translate(-28px, -28px); }
.f-tr { top: 0; right: 0; border-left: none; border-bottom: none; transform: translate(28px, -28px); }
.f-bl { bottom: 0; left: 0; border-right: none; border-top: none; transform: translate(-28px, 28px); }
.f-br { bottom: 0; right: 0; border-left: none; border-top: none; transform: translate(28px, 28px); }

@media (prefers-reduced-motion: no-preference) {
  .fcorner { transition: transform 0.9s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.7s ease; }

  /* Blur only when JS is running (home.js stamps html.js), so content is
     never stuck blurred if scripts fail to load. */
  html.js .focus-content {
    filter: blur(7px);
    opacity: 0.35;
    transition: filter 1s ease 0.15s, opacity 1s ease 0.15s;
  }

  html.js .focus-frame.in-focus .focus-content { filter: blur(0); opacity: 1; }

  /* Focus-pull on load: mesh and headline resolve from blur, like a lens racking. */
  #mesh { animation: focus-pull 1.7s ease-out both; }
  .hero-copy h1 { animation: focus-pull 1.4s ease-out 0.2s both; }

  @keyframes focus-pull {
    from { filter: blur(10px); opacity: 0.25; }
    to   { filter: blur(0);    opacity: 1; }
  }
}

.focus-frame.in-focus .fcorner { opacity: 1; transform: translate(0, 0); }

/* Reduced motion / no-JS fallback: everything visible and sharp. */
@media (prefers-reduced-motion: reduce) {
  .fcorner { opacity: 1; transform: none; }
}

.what h2 {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--navy-60);
  margin-bottom: 1rem;
}

.what p { max-width: 34rem; font-size: 1.35rem; line-height: 1.5; letter-spacing: -0.01em; }

.contact {
  display: inline-block;
  margin-top: 1.75rem;
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1.5px solid var(--navy-30);
  padding-bottom: 1px;
}

.contact:hover { border-color: var(--blue); }

.foot {
  max-width: var(--max);
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
  border-top: 1px solid var(--navy-12);
  color: var(--navy-60);
  font-size: 0.8rem;
}

.foot a { color: var(--navy-60); }
.foot a:hover { color: var(--navy); }

.legal {
  max-width: 720px;
  margin: 0 auto;
  padding: 3rem 1.5rem 4rem;
}

.legal h1 { font-size: 1.6rem; letter-spacing: -0.02em; margin-bottom: 1.25rem; }
.legal p { color: var(--navy-60); font-size: 0.95rem; margin-bottom: 1rem; }

/* ---------- Auth (login / register) ---------- */

.auth-wrap {
  max-width: 460px;
  margin: 9vh auto 0;
  padding: 0 1.5rem;
}

.auth-frame { padding: 2.25rem 2.5rem; }
@media (max-width: 480px) { .auth-frame { padding: 1.75rem 1.5rem; } }

.auth-wrap h1 { font-size: 1.6rem; letter-spacing: -0.02em; margin-bottom: 0.4rem; }
.auth-wrap .sub { color: var(--navy-60); font-size: 0.95rem; margin-bottom: 2rem; }

.field { margin-bottom: 1rem; }

.field label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: var(--navy-60);
}

.field input {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--navy-30);
  border-radius: 8px;
  font: inherit;
  color: var(--navy);
  background: var(--white);
}

.field input:focus { outline: 2px solid var(--blue); outline-offset: 1px; border-color: transparent; }

.auth-wrap .btn { width: 100%; margin-top: 0.5rem; padding: 0.8rem; }

.form-error {
  color: #a02015;
  font-size: 0.85rem;
  min-height: 1.3rem;
  margin-top: 0.75rem;
}

.auth-toggle { margin-top: 1.5rem; font-size: 0.9rem; color: var(--navy-60); }
.auth-toggle a { font-weight: 600; text-decoration: none; }

/* ---------- Forum ---------- */

.forum-main { max-width: 760px; margin: 0 auto; padding: 1rem 1.5rem 5rem; }

.forum-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin: 1.5rem 0;
  flex-wrap: wrap;
}

.forum-head h1 { font-size: 1.5rem; letter-spacing: -0.02em; }

.thread-list { list-style: none; border-top: 1px solid var(--navy-12); }

.thread-list li { border-bottom: 1px solid var(--navy-12); }

.thread-list a {
  display: block;
  padding: 1rem 0.25rem;
  text-decoration: none;
  color: var(--navy);
}

.thread-list a:hover { background: var(--navy-05); }

.thread-list .t-title { font-weight: 600; }
.thread-list .t-meta { font-size: 0.8rem; color: var(--navy-60); margin-top: 0.15rem; }

.post {
  border: 1px solid var(--navy-12);
  border-radius: 10px;
  padding: 1rem 1.15rem;
  margin-bottom: 0.9rem;
}

.post .p-meta { font-size: 0.8rem; color: var(--navy-60); margin-bottom: 0.5rem; }
.post .p-meta b { color: var(--navy); }
.post .p-body { white-space: pre-wrap; overflow-wrap: break-word; }

textarea, .composer input {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--navy-30);
  border-radius: 8px;
  font: inherit;
  color: var(--navy);
  resize: vertical;
}

textarea:focus, .composer input:focus { outline: 2px solid var(--blue); outline-offset: 1px; }

.composer { margin-top: 1.5rem; display: grid; gap: 0.75rem; }
.composer .btn { justify-self: start; }

.back-link { font-size: 0.9rem; text-decoration: none; font-weight: 600; }

.admin-box {
  margin-top: 3rem;
  padding: 1rem 1.15rem;
  background: var(--navy-05);
  border-radius: 10px;
  font-size: 0.9rem;
}

.admin-box code {
  background: var(--white);
  border: 1px solid var(--navy-12);
  border-radius: 6px;
  padding: 0.15rem 0.5rem;
  font-size: 0.95em;
}

.muted { color: var(--navy-60); font-size: 0.9rem; }

.topbar-nav { display: flex; gap: 0.6rem; align-items: center; }

.btn-sm { padding: 0.35rem 0.8rem; font-size: 0.8rem; }
.btn-danger { color: #a02015; border-color: rgba(160, 32, 21, 0.4); }
.btn-danger:hover { background: rgba(160, 32, 21, 0.06); }

.p-delete {
  margin-left: 0.75rem;
  background: none;
  border: none;
  color: var(--navy-60);
  font: inherit;
  font-size: 0.75rem;
  cursor: pointer;
  text-decoration: underline;
}

.p-delete:hover { color: #a02015; }

/* ---------- Dashboard shell ---------- */

body.app { background: #fafbfc; }

.shell { display: flex; min-height: 100vh; }

.side {
  width: 250px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  padding: 1.3rem 0.9rem;
  border-right: 1px solid var(--navy-12);
  background: var(--white);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.side .wordmark { padding: 0 0.5rem 1.25rem; font-size: 0.95rem; }

.side-nav { flex: 1; }

.side-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--navy-30);
  padding: 1.1rem 0.5rem 0.35rem;
}

.side-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.5rem 0.6rem;
  border: none;
  border-radius: 8px;
  background: none;
  color: var(--navy);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
}

.side-item:hover { background: var(--navy-05); }
.side-item.is-active { background: var(--navy-05); font-weight: 600; }

.side-foot { border-top: 1px solid var(--navy-12); padding-top: 0.75rem; }
.side-user { font-size: 0.85rem; font-weight: 600; padding: 0.25rem 0.6rem 0.4rem; }

.content { flex: 1; padding: 2.25rem 2.5rem 4rem; min-width: 0; }

.content-head { margin-bottom: 1.5rem; }
.content-head h1 { font-size: 1.45rem; letter-spacing: -0.02em; }
.content-head .muted { margin-top: 0.2rem; }

.card {
  background: var(--white);
  border: 1px solid var(--navy-12);
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.card-head { margin-bottom: 0.75rem; }

/* ---------- Document rows ---------- */

.doc-list { display: flex; flex-direction: column; }

.doc-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 0.25rem;
  border-bottom: 1px solid var(--navy-12);
}

#docs-view .doc-row { background: var(--white); border: 1px solid var(--navy-12); border-radius: 10px; padding: 0.85rem 1rem; margin-bottom: 0.6rem; }

.doc-main { min-width: 0; }

.doc-name {
  display: block;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--navy);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.doc-name:hover { color: var(--blue); }

.doc-meta { font-size: 0.78rem; color: var(--navy-60); margin-top: 0.15rem; }

.doc-actions { display: flex; gap: 0.5rem; flex-shrink: 0; }

/* ---------- Upload ---------- */

.upload-controls { display: flex; gap: 1.25rem; flex-wrap: wrap; margin-bottom: 1rem; }

.upload-controls label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--navy-60);
}

.upload-controls select {
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--navy-30);
  border-radius: 8px;
  font: inherit;
  color: var(--navy);
  background: var(--white);
  min-width: 180px;
}

.dropzone {
  border: 2px dashed var(--navy-30);
  border-radius: 12px;
  padding: 2.25rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease;
}

.dropzone:hover, .dropzone:focus-visible, .dropzone.is-drag {
  border-color: var(--blue);
  background: rgba(21, 84, 160, 0.04);
  outline: none;
}

.dropzone .muted { margin-top: 0.3rem; font-size: 0.8rem; }

.invite-row { display: flex; align-items: center; gap: 0.75rem; margin-top: 0.75rem; flex-wrap: wrap; }

.invite-row code, .admin-box code {
  background: var(--navy-05);
  border: 1px solid var(--navy-12);
  border-radius: 6px;
  padding: 0.25rem 0.6rem;
  font-size: 0.95em;
}

/* ---------- Small screens ---------- */

@media (max-width: 720px) {
  #mesh { left: 0; width: 100%; opacity: 0.16; }
  .hero { min-height: 48vh; }
  .topbar { padding: 1rem 1.1rem; gap: 0.75rem; }
  .what p { font-size: 1.15rem; }
}

/* Compact header on small phones: smaller logo, tighter nav */
@media (max-width: 560px) {
  .brand-logo, body.home .brand-logo { height: 26px; }
  .home-nav { gap: 0.8rem; }
  .nav-link { font-size: 0.78rem; }
  .topbar .btn { padding: 0.42rem 0.8rem; font-size: 0.78rem; }
  .wordmark { font-size: 0.85rem; }
}

@media (max-width: 860px) {
  .shell { flex-direction: column; }
  .side {
    width: 100%;
    height: auto;
    position: static;
    border-right: none;
    border-bottom: 1px solid var(--navy-12);
    padding: 0.9rem 1rem;
  }
  .side .wordmark { padding-bottom: 0.6rem; }
  .side-nav { display: flex; flex-wrap: wrap; gap: 0.25rem; align-items: center; }
  .side-label { display: none; }
  .side-item { width: auto; padding: 0.45rem 0.75rem; border: 1px solid var(--navy-12); border-radius: 999px; font-size: 0.82rem; }
  #admin-nav { display: contents; }
  .side-foot { display: flex; align-items: center; gap: 0.5rem; border-top: none; padding-top: 0.6rem; }
  .content { padding: 1.5rem 1.1rem 3rem; }
  .doc-row { flex-direction: column; align-items: flex-start; gap: 0.6rem; }
  .doc-actions { align-self: stretch; }
  .doc-actions .btn { flex: 1; text-align: center; }
  .forum-head { align-items: center; }
}
