/* Gibson Architecture client portal – house style tokens */
:root {
  --ink: #171716;
  --muted: #6B6B66;
  --sage: #D8DDCF;
  --pale: #F4F4EF;
  --stone: #CEC9BF;
  --yellow: #FFD800;
  --yellow-tint: #FFF6B3;
  --bg: #FFFFFF;
  --surface: #FFFFFF;
  --track: #E6E6DC;
  --paper: #EEF0EA;
  --on-ink: #FFFFFF;
  --on-yellow: #171716;
  --font: Poppins, 'Helvetica Neue', Arial, sans-serif;
  --radius: 16px;
  --radius-sm: 14px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #F1F0EA;
    --muted: #A9A8A0;
    --sage: #2C3127;
    --pale: #1F1F1D;
    --stone: #3B3A36;
    --yellow-tint: #3A3412;
    --bg: #141413;
    --surface: #1A1A18;
    --track: #33332F;
    --on-ink: #141413;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 96px; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--ink); }
a:hover { color: var(--muted); }
h1, h2, h3, p { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; border-radius: 4px; }

.wrap { max-width: 1200px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }
.muted { color: var(--muted); }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; z-index: 100; background: var(--bg); padding: 8px 12px; }

/* Wordmark */
.wordmark { display: flex; align-items: stretch; gap: 10px; text-decoration: none; color: var(--ink); font-size: 18px; line-height: 1.1; }
.wordmark .bar { width: 4px; background: var(--yellow); }
.wordmark b { font-weight: 700; }

/* Buttons and pills */
.btn {
  font: inherit; font-size: 14px; font-weight: 600; min-height: 44px; padding: 0 18px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 999px; border: 1px solid var(--ink); background: var(--ink); color: var(--on-ink);
  text-decoration: none; cursor: pointer;
}
.btn:hover { color: var(--on-ink); opacity: .9; }
.btn-outline { background: transparent; color: var(--ink); }
.btn-outline:hover { color: var(--ink); background: var(--pale); }
.btn-quiet { background: var(--surface); color: var(--ink); border-color: var(--stone); font-weight: 400; font-size: 13px; padding: 0 14px; }
.btn-quiet:hover { color: var(--ink); background: var(--pale); }
.btn-block { width: 100%; }
.pill { display: inline-block; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; }
.pill-ink { background: var(--ink); color: var(--on-ink); }
.pill-sage { background: var(--sage); color: var(--ink); }
.pill-yellow { background: var(--yellow); color: var(--on-yellow); }
.avatar {
  width: 40px; height: 40px; flex: none; border-radius: 999px; background: var(--sage);
  display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: 14px;
}

/* ---------- Log-in screen ---------- */
.login { min-height: 100vh; display: flex; flex-wrap: wrap; }
.login-brand {
  flex: 1 1 420px; min-width: 0; background: var(--sage); padding: 40px;
  display: flex; flex-direction: column; justify-content: space-between; gap: 32px;
}
.login-brand .intro { display: flex; flex-direction: column; gap: 14px; max-width: 480px; }
.login-brand h1 { font-size: 40px; line-height: 1.1; font-weight: 700; }
.login-brand p { font-size: 16px; line-height: 1.6; }
.login-brand svg { width: 100%; max-width: 420px; height: auto; display: block; margin-top: 12px; color: var(--ink); }
.login-brand .foot { font-size: 13px; }
.login-panel { flex: 1 1 420px; min-width: 0; padding: 40px 24px; display: flex; align-items: center; justify-content: center; }
.login-form { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 18px; }
.login-form h2 { font-size: 28px; font-weight: 700; }
.login-form p { font-size: 15px; line-height: 1.6; }
.login-form .small { font-size: 13px; color: var(--muted); line-height: 1.5; }
.notice { background: var(--yellow-tint); border-radius: 10px; padding: 10px 14px; font-size: 13px; }

/* ---------- Header ---------- */
.topbar { border-bottom: 1px solid var(--stone); background: var(--bg); position: sticky; top: 0; z-index: 10; }
.topbar-inner { padding-top: 18px; padding-bottom: 18px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.sections { display: flex; flex-wrap: wrap; gap: 4px; font-size: 14px; }
.sections a { padding: 12px 14px; border-radius: 999px; text-decoration: none; }
.sections a[aria-current="true"] { background: var(--ink); color: var(--on-ink); }
.user { display: flex; align-items: center; gap: 10px; font-size: 14px; }

/* ---------- Status / empty pages ---------- */
.status { padding-top: 64px; padding-bottom: 64px; }
.status:empty { display: none; }
.status-card { max-width: 560px; display: flex; flex-direction: column; gap: 14px; }
.status-card h1 { font-size: 28px; font-weight: 700; }
.status-card p { font-size: 15px; line-height: 1.6; }
.picker { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.picker a { display: flex; flex-direction: column; gap: 2px; padding: 16px 18px; border: 1px solid var(--stone); border-radius: var(--radius-sm); text-decoration: none; }
.picker a:hover { background: var(--pale); color: var(--ink); }
.picker strong { font-weight: 600; }
.picker span { font-size: 13px; color: var(--muted); }

/* ---------- Hero ---------- */
.hero { background: var(--sage); }
.hero-inner { padding-top: 48px; padding-bottom: 64px; display: flex; flex-wrap: wrap; gap: 40px; align-items: center; }
.hero-text { flex: 999 1 460px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.hero-text .hello { font-size: 15px; }
.hero-text h1 { font-size: 44px; line-height: 1.1; font-weight: 700; }
.hero-text .address { font-size: 16px; }
.hero-text .desc { font-size: 14px; line-height: 1.6; max-width: 560px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; font-size: 13px; }
.chips span { padding: 8px 12px; background: var(--surface); border-radius: 999px; }
.hero-figure { flex: 1 1 380px; min-width: 0; margin: 0; background: var(--paper); border-radius: var(--radius); padding: 20px; }
.hero-figure img, .hero-figure svg { width: 100%; height: auto; display: block; }
.hero-figure svg { color: #171716; }
.hero-figure figcaption { margin-top: 12px; font-size: 13px; color: #6B6B66; }

/* ---------- Stage tracker ---------- */
.tracker-wrap { margin-top: -24px; position: relative; }
.tracker { background: var(--surface); border: 1px solid var(--stone); border-radius: var(--radius); padding: 24px 28px; display: flex; flex-direction: column; gap: 18px; }
.row-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px; }
.row-head h2 { font-size: 18px; font-weight: 600; }
.row-head .muted { font-size: 14px; }
.stages { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 16px 8px; }
.stages li { display: flex; flex-direction: column; gap: 8px; }
.stages .bar { height: 8px; border-radius: 999px; background: var(--track); }
.stages .done .bar { background: var(--ink); }
.stages .now .bar { background: var(--yellow); }
.stages .name { font-size: 14px; font-weight: 500; }
.stages .now .name { font-weight: 700; }
.stages .note { font-size: 12px; color: var(--muted); }

/* ---------- Main layout ---------- */
.main { padding-top: 40px; padding-bottom: 24px; display: flex; flex-wrap: wrap; gap: 32px; align-items: flex-start; }
.col-main { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 40px; }
.col-side { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.block { display: flex; flex-direction: column; gap: 14px; }
.block > .row-head h2, .block > h2 { font-size: 22px; font-weight: 600; }
.col-side .block > h2, .col-side .row-head h2 { font-size: 18px; }
.empty { font-size: 14px; color: var(--muted); line-height: 1.5; padding: 18px; border: 1px dashed var(--stone); border-radius: var(--radius-sm); }
.footnote { font-size: 13px; color: var(--muted); }

/* Waiting on you */
.count { font-size: 13px; font-weight: 600; padding: 2px 10px; border-radius: 999px; background: var(--track); }
.count.has { background: var(--yellow); color: var(--on-yellow); }
.title-row { display: flex; align-items: center; gap: 10px; }
.title-row h2 { font-size: 22px; font-weight: 600; }
.action-card { background: var(--yellow-tint); border-radius: var(--radius-sm); padding: 20px; display: flex; flex-direction: column; gap: 4px; }
.action-card strong { font-size: 16px; font-weight: 600; }
.action-card span { font-size: 14px; line-height: 1.5; }

/* Drawings */
.drawings { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.drawing { text-decoration: none; color: var(--ink); border: 1px solid var(--stone); border-radius: var(--radius-sm); overflow: hidden; display: flex; flex-direction: column; }
a.drawing:hover { color: var(--ink); border-color: var(--ink); }
.drawing .thumb { background: var(--pale); padding: 18px; position: relative; color: var(--ink); }
.drawing .thumb svg { width: 100%; height: auto; display: block; }
.drawing .tag { position: absolute; top: 10px; left: 10px; font-size: 11px; padding: 3px 8px; }
.drawing .info { padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.drawing strong { font-size: 14px; font-weight: 600; }
.drawing .meta { font-size: 12px; color: var(--muted); }

/* Materials */
.materials { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: 120px; gap: 10px; }
.swatch { border-radius: var(--radius-sm); display: flex; flex-direction: column; justify-content: flex-end; align-items: flex-start; gap: 6px; padding: 12px; background: var(--pale); }
.swatch.large { grid-column: span 2; grid-row: span 2; padding: 14px; }
.swatch .label { background: #FFFFFF; color: #171716; font-size: 12px; padding: 4px 10px; border-radius: 999px; }
.swatch .note { font-size: 12px; color: #171716; }

/* Planning */
.card { border: 1px solid var(--stone); border-radius: var(--radius); padding: 22px; display: flex; flex-direction: column; gap: 16px; }
.card .row-head { align-items: center; }
.card .sub { font-size: 13px; color: var(--muted); }
.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.timeline li { display: flex; gap: 12px; align-items: flex-start; }
.timeline .step { font-size: 14px; font-weight: 500; }
.timeline .date { font-size: 12px; color: var(--muted); }
.dot { width: 14px; height: 14px; margin-top: 3px; flex: none; border-radius: 999px; border: 2px solid var(--stone); }
.dot.done { background: var(--ink); border-color: var(--ink); }
.dot.now { background: var(--yellow); border-color: var(--ink); }
.note-box { background: var(--pale); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; line-height: 1.5; }
.note-box strong { font-weight: 600; }

/* News */
.news-item { border-top: 1px solid var(--stone); padding-top: 12px; display: flex; flex-direction: column; gap: 4px; }
.news-item .date { font-size: 12px; color: var(--muted); }
.news-item strong { font-size: 14px; font-weight: 600; }
.news-item span { font-size: 13px; line-height: 1.5; }

/* Team */
.team { background: var(--pale); border-radius: var(--radius); padding: 22px; display: flex; flex-direction: column; gap: 12px; }
.person { display: flex; gap: 12px; align-items: center; }
.person .avatar { width: 44px; height: 44px; }
.person div { display: flex; flex-direction: column; }
.person .who { font-size: 14px; font-weight: 600; }
.person .role { font-size: 12px; color: var(--muted); }
.team .contact { font-size: 13px; }

/* Agreement */
.agreement-row { display: flex; flex-wrap: wrap; gap: 20px; align-items: stretch; }
.appointment { flex: 1 1 320px; min-width: 0; background: var(--pale); border-radius: var(--radius); padding: 22px; display: flex; flex-direction: column; gap: 14px; }
.appointment .row-head strong, .gates .row-head strong { font-size: 16px; font-weight: 600; }
.appointment .sub { font-size: 13px; color: var(--muted); }
.appointment .body { font-size: 14px; line-height: 1.5; }
.appointment .changes { border-top: 1px solid var(--stone); padding-top: 12px; display: flex; flex-direction: column; gap: 4px; }
.appointment .changes strong { font-size: 14px; font-weight: 600; }
.appointment .changes span { font-size: 13px; color: var(--muted); }
.gates { flex: 999 1 560px; min-width: 0; border: 1px solid var(--stone); border-radius: var(--radius); padding: 22px; display: flex; flex-direction: column; gap: 14px; }
.gates .row-head .muted { font-size: 13px; }
.gate { border-top: 1px solid var(--stone); padding-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.gate .row-head { align-items: center; }
.gate .gname { font-size: 14px; font-weight: 600; }
.gate .gref { font-size: 12px; color: var(--muted); }
.gate ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px 8px; }
.gate li { display: flex; gap: 8px; align-items: flex-start; }
.gate li > span:last-child { display: flex; flex-direction: column; }
.gate .glabel { font-size: 13px; font-weight: 500; }
.gate .gnote { font-size: 12px; color: var(--muted); }

/* Documents */
.filters { display: flex; flex-wrap: wrap; gap: 6px; }
.filter { font: inherit; font-size: 13px; min-height: 44px; padding: 0 14px; border-radius: 999px; cursor: pointer; background: var(--surface); color: var(--ink); border: 1px solid var(--stone); }
.filter[aria-pressed="true"] { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.table-box { overflow-x: auto; border: 1px solid var(--stone); border-radius: var(--radius-sm); }
table { width: 100%; min-width: 560px; border-collapse: collapse; font-size: 14px; }
th { background: var(--pale); text-align: left; padding: 12px 16px; font-size: 12px; font-weight: 600; }
td { padding: 14px 16px; border-top: 1px solid var(--stone); color: var(--muted); }
td:first-child { color: var(--ink); font-weight: 500; }

/* Footer */
.footer { border-top: 1px solid var(--stone); }
.footer .wrap { padding-top: 20px; padding-bottom: 20px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); }

/* Bottom nav (phone only) */
.bottomnav { display: none; }

/* ---------- Phone ---------- */
@media (max-width: 720px) {
  html { scroll-padding-top: 84px; }
  .wrap { padding-left: 16px; padding-right: 16px; }
  .topbar-inner { padding-top: 14px; padding-bottom: 14px; flex-wrap: nowrap; }
  .wordmark { font-size: 15px; gap: 8px; }
  .wordmark .bar { width: 3px; }
  .sections, .user-name { display: none; }

  .login-brand { padding: 28px 20px; flex-basis: 100%; }
  .login-brand h1 { font-size: 30px; }
  .login-brand svg { max-width: 260px; }
  .login-panel { padding: 32px 16px 48px; flex-basis: 100%; }

  .hero-inner { padding-top: 24px; padding-bottom: 48px; gap: 20px; }
  .hero-text h1 { font-size: 28px; line-height: 1.15; }
  .hero-text .address { font-size: 14px; }
  .hero-figure { padding: 14px; }
  .tracker { padding: 16px; }
  .stages { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; }
  .stages .bar { height: 6px; }
  .stages .name, .stages .note { display: none; }

  /* One column, ordered like the phone mockup */
  .main { flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: 28px; padding-top: 28px; }
  .col-main, .col-side { display: contents; }
  #waiting { order: 1; }
  #planning { order: 2; }
  #drawings { order: 3; }
  #materials { order: 4; }
  #updates { order: 5; }
  .team { order: 6; }
  .block > .row-head h2, .block > h2, .title-row h2 { font-size: 18px; }
  .drawings { display: flex; overflow-x: auto; gap: 12px; padding-bottom: 4px; }
  .drawing { flex: none; width: 200px; }
  .materials { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: 90px; gap: 8px; }
  .swatch { padding: 8px; }
  .swatch .label { font-size: 11px; padding: 3px 8px; }
  .swatch .note { display: none; }

  body.has-project { padding-bottom: 84px; }
  .bottomnav {
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
    background: var(--bg); border-top: 1px solid var(--stone);
    padding: 8px 8px calc(12px + env(safe-area-inset-bottom));
  }
  .bottomnav a { min-height: 44px; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; text-decoration: none; }
  .bottomnav a[aria-current="true"] { font-weight: 600; }
  .bottomnav svg { width: 22px; height: 22px; }
}
