/* ============================================================================
   w_brand.css — Corridors for Carnabys shared brand/theme layer
   ----------------------------------------------------------------------------
   Single source of truth for palette, typography and base element styling.
   Every page links this once:  <link rel="stylesheet" href="/shared/css/w_brand.css">
   Page-specific layout stays in each page; identity tokens live here.

   Palette
     base    #2B2A17 (near-black bark)   #DFD8CE (sand)
     accent  #394B26 (eucalypt green)    #FFFFFF  #F5F4EB (cream)  #BEC8B2 (sage)
   Type
     titles  Fraunces
     body    Atkinson Hyperlegible
   ============================================================================ */

/* --- Fonts: Atkinson Hyperlegible (body) + Fraunces (titles) ------------- */
@import url('https://fonts.googleapis.com/css2?family=Atkinson+Hyperlegible:ital,wght@0,400;0,700;1,400;1,700&family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600;9..144,700&display=swap');

:root{
  /* Brand palette ------------------------------------------------------- */
  --c-bark:        #2B2A17;   /* base dark */
  --c-sand:        #DFD8CE;   /* base light */
  --c-green:       #394B26;   /* accent / primary action */
  --c-white:       #FFFFFF;
  --c-cream:       #F5F4EB;   /* panel / card surface */
  --c-sage:        #BEC8B2;   /* soft accent / lines */

  /* Derived greens (hover / focus) ------------------------------------- */
  --c-green-hi:    #46602f;   /* lighter green for hover */
  --c-green-lo:    #2b3a1d;   /* darker green */

  /* Semantic roles ----------------------------------------------------- */
  --brand:         var(--c-green);
  --brand-2:       var(--c-green-hi);
  --ink:           var(--c-bark);
  --muted:         #6f6b57;          /* bark-tinted grey for secondary text */
  --line:          var(--c-sage);
  --panel:         var(--c-cream);
  --surface:       var(--c-white);   /* card background */
  --bg:            var(--c-bark);    /* page background */
  --err:           #a83b32;
  --ok:            #3f6b2e;

  /* Typography --------------------------------------------------------- */
  --font-title:    'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body:     'Atkinson Hyperlegible', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  /* Shape -------------------------------------------------------------- */
  --radius:        16px;
  --radius-sm:     10px;
  --shadow:        0 18px 48px rgba(20, 18, 8, .38);
}

*{ box-sizing:border-box; }

html{
  /* App-wide base font bump for readability. Everything sized in rem/em scales
     from here, so this lifts the whole app at once. */
  font-size:18px;
}
body{
  margin:0;
  font-family:var(--font-body);
  font-size:1rem;
  line-height:1.5;
  color:var(--ink);
  background:
    radial-gradient(1200px 680px at 50% -10%, #3a3822 0%, rgba(58,56,34,0) 60%),
    linear-gradient(165deg, #2f2d1a 0%, #211f12 100%);
  background-attachment:fixed;
  min-height:100vh;
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;
}

/* --- Headings: Fraunces -------------------------------------------------- */
h1, h2, h3{
  font-family:var(--font-title);
  font-optical-sizing:auto;
  font-weight:600;
  letter-spacing:.1px;
  margin:.2em 0;
}

/* --- Brand lockup (logo + wordmark) ------------------------------------- */
.brand-logo{
  display:block;
  width:112px; height:auto;
  margin:0 auto 2px;
}
.brand-logo.sm{ width:72px; }
.brand-logo.lg{ width:150px; }

.kicker{
  text-align:center;
  letter-spacing:.24em;
  text-transform:uppercase;
  font-size:.64rem;
  font-weight:700;
  color:var(--brand);
  margin:6px 0 2px;
}

/* --- Card surface -------------------------------------------------------- */
.card{
  width:100%;
  max-width:420px;
  background:var(--surface);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  padding:30px 28px 24px;
}
.wrap{
  display:flex;
  align-items:flex-start;
  justify-content:center;
  padding:40px 16px;
}

/* --- Form controls ------------------------------------------------------- */
label{
  display:block;
  font-size:.8rem; font-weight:700;
  color:var(--ink);
  margin:14px 0 6px;
}
input{
  width:100%;
  padding:13px 14px;
  font-size:1rem;
  font-family:inherit;
  color:var(--ink);
  border:1.5px solid var(--line);
  border-radius:var(--radius-sm);
  background:var(--c-white);
  transition:border-color .15s, box-shadow .15s;
}
input:focus{
  outline:none;
  border-color:var(--brand);
  box-shadow:0 0 0 3px rgba(57,75,38,.15);
}

/* --- Buttons ------------------------------------------------------------- */
button.primary{
  width:100%;
  margin-top:18px;
  padding:14px;
  font-size:1rem; font-weight:700;
  font-family:inherit;
  color:var(--c-white);
  background:var(--brand);
  border:0; border-radius:var(--radius-sm);
  cursor:pointer;
  transition:background .15s, transform .02s;
}
button.primary:hover:not(:disabled){ background:var(--brand-2); }
button.primary:active:not(:disabled){ transform:translateY(1px); }
button.primary:disabled{ opacity:.55; cursor:default; }

button.secondary{
  width:100%;
  margin-top:10px;
  padding:8px;
  font-size:.86rem; font-weight:700;
  font-family:inherit;
  color:var(--brand);
  background:transparent;
  border:0; cursor:pointer;
  border-radius:8px;
}
button.secondary:hover:not(:disabled){ background:var(--panel); }

/* --- Messages ------------------------------------------------------------ */
.msg{
  margin-top:14px;
  padding:10px 12px;
  border-radius:9px;
  font-size:.85rem; line-height:1.4;
  display:none;
}
.msg.err{ display:block; background:#f6e7e5; color:var(--err); border:1px solid #e6c9c5; }
.msg.ok{ display:block; background:#eaf2e2; color:var(--ok); border:1px solid #cfe0bd; }
.msg.info{ display:block; background:var(--panel); color:var(--muted); border:1px solid var(--line); }

/* --- Helpers ------------------------------------------------------------- */
.sub{ text-align:center; color:var(--muted); font-size:.9rem; line-height:1.45; margin:0 0 20px; }
.muted{ color:var(--muted); font-size:.78rem; }
.footer{ text-align:center; margin-top:20px; font-size:.68rem; letter-spacing:.04em; color:rgba(255,255,255,.5); }

/* --- Spinner ------------------------------------------------------------- */
.spin{
  display:inline-block; width:15px; height:15px;
  border:2.5px solid rgba(255,255,255,.4); border-top-color:#fff;
  border-radius:50%; animation:sp .7s linear infinite;
  vertical-align:-2px; margin-right:7px;
}
@keyframes sp{ to{ transform:rotate(360deg); } }

/* ============================================================================
   Shared chrome — top app bar + feedback button (injected by w_chrome.js)
   ============================================================================ */

/* --- top app bar: logo + wordmark across the top ------------------------- */
.appbar{
  position:sticky; top:0; left:0; right:0; z-index:40;
  display:flex; align-items:center; gap:10px;
  padding:8px 16px;
  background:rgba(28,27,16,.92);
  backdrop-filter:saturate(1.1) blur(6px);
  -webkit-backdrop-filter:saturate(1.1) blur(6px);
  border-bottom:1px solid rgba(190,200,178,.18);
}
.appbar-brand{ display:flex; align-items:center; gap:10px; text-decoration:none; }
.appbar-logo{ display:block; width:34px; height:34px; }
.appbar-word{
  font-family:var(--font-title);
  font-weight:600;
  font-size:1.12rem;
  letter-spacing:.2px;
  color:var(--c-sand);
}
/* give the page a little breathing room under a sticky bar */
body.has-appbar .wrap{ padding-top:24px; }

/* --- feedback button: small, fixed, on every page ------------------------ */
.fab-feedback{
  position:fixed; right:14px; bottom:14px; z-index:50;
  display:inline-flex; align-items:center; gap:6px;
  padding:10px 14px;
  font-family:var(--font-body); font-size:.86rem; font-weight:700;
  color:var(--c-white); background:var(--brand);
  border:0; border-radius:999px;
  box-shadow:0 6px 18px rgba(20,18,8,.35);
  cursor:pointer;
  transition:background .15s, transform .02s;
}
.fab-feedback:hover{ background:var(--brand-2); }
.fab-feedback:active{ transform:translateY(1px); }

/* --- share row (upload success) ------------------------------------------ */
.share-row{
  display:flex; flex-wrap:wrap; gap:8px; justify-content:center;
  margin:16px 0 4px;
}
.share-btn{
  display:inline-flex; align-items:center; gap:6px;
  padding:10px 14px;
  font-family:var(--font-body); font-size:.9rem; font-weight:700;
  border:1.5px solid var(--line); border-radius:var(--radius-sm);
  background:var(--c-white); color:var(--brand); cursor:pointer;
  text-decoration:none;
}
.share-btn:hover{ border-color:var(--brand); background:var(--panel); }
.share-btn.primary{ color:var(--c-white); background:var(--brand); border-color:var(--brand); }
.share-btn.primary:hover{ background:var(--brand-2); }

/* --- feedback modal ------------------------------------------------------ */
.fb-modal{
  position:fixed; inset:0; z-index:60;
  display:flex; align-items:center; justify-content:center;
  padding:20px;
  background:rgba(20,18,8,.55);
  backdrop-filter:blur(3px); -webkit-backdrop-filter:blur(3px);
}
.fb-card{
  width:100%; max-width:420px;
  background:var(--surface); color:var(--ink);
  border-radius:var(--radius); box-shadow:var(--shadow);
  padding:22px 20px;
}
.fb-title{ font-family:var(--font-title); font-size:1.3rem; color:var(--brand); margin:0 0 6px; }
.fb-sub{ color:var(--muted); font-size:.9rem; line-height:1.45; margin:0 0 12px; }
.fb-text{
  width:100%; padding:12px 14px; font-size:1rem; font-family:inherit;
  color:var(--ink); background:var(--c-white);
  border:1.5px solid var(--line); border-radius:var(--radius-sm);
  resize:vertical; min-height:96px;
}
.fb-text:focus{ outline:none; border-color:var(--brand); box-shadow:0 0 0 3px rgba(57,75,38,.15); }
.fb-actions{ display:flex; gap:8px; justify-content:flex-end; margin-top:14px; }
.fb-cancel, .fb-send{
  padding:10px 16px; font-family:inherit; font-size:.9rem; font-weight:700;
  border-radius:var(--radius-sm); cursor:pointer; border:0;
}
.fb-cancel{ background:transparent; color:var(--muted); border:1.5px solid var(--line); }
.fb-cancel:hover{ background:var(--panel); }
.fb-send{ background:var(--brand); color:var(--c-white); }
.fb-send:hover:not(:disabled){ background:var(--brand-2); }
.fb-send:disabled{ opacity:.6; cursor:default; }
.fb-msg{ margin-top:10px; padding:8px 10px; border-radius:8px; font-size:.85rem; }
.fb-msg.ok{ background:#eaf2e2; color:var(--ok); border:1px solid #cfe0bd; }
.fb-msg.err{ background:#f6e7e5; color:var(--err); border:1px solid #e6c9c5; }
