/* --------------------------------------------------------------------------
   Israel Dryer — site styles
   Token order matters: every colour is declared on bare :root first, then
   redefined under prefers-color-scheme and [data-theme] so all three viewer
   states (explicit light, explicit dark, unset/system) resolve as a full set.
   -------------------------------------------------------------------------- */

html, body { margin: 0; }
img { max-width: 100%; }
[hidden] { display: none !important; }

  :root {
    --ground:   #E9ECF1;
    --surface:  #FFFFFF;
    --sunken:   #F3F5F8;
    --ink:      #10151C;
    --muted:    #5B6675;
    --faint:    #8A94A3;
    --line:     #D0D6DE;
    --hairline: #E2E6EC;
    --accent:   #23458F;
    --accent-2: #3A6FD8;
    --btn-bg:   #14295C;
    --btn-bg-h: #1E3D82;
    --btn-fg:   #FFFFFF;
    --shadow:   0 1px 2px rgba(16,21,28,.06), 0 8px 24px -12px rgba(16,21,28,.18);
    --font-display: 'Familjen Grotesk', 'Helvetica Neue', Arial, sans-serif;
    --font-body: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  }

  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
      --ground:   #0F1319;
      --surface:  #171C24;
      --sunken:   #12171E;
      --ink:      #E6EBF2;
      --muted:    #9AA5B4;
      --faint:    #6B7686;
      --line:     #2A313B;
      --hairline: #222932;
      --accent:   #7FA6FF;
      --accent-2: #A8C2FF;
      --btn-bg:   #24509E;
      --btn-bg-h: #2E63C4;
      --btn-fg:   #FFFFFF;
      --shadow:   0 1px 2px rgba(0,0,0,.4), 0 8px 24px -12px rgba(0,0,0,.6);
    }
  }

  :root[data-theme="dark"] {
    --ground:   #0F1319;
    --surface:  #171C24;
    --sunken:   #12171E;
    --ink:      #E6EBF2;
    --muted:    #9AA5B4;
    --faint:    #6B7686;
    --line:     #2A313B;
    --hairline: #222932;
    --accent:   #7FA6FF;
    --accent-2: #A8C2FF;
    --btn-bg:   #24509E;
    --btn-bg-h: #2E63C4;
    --btn-fg:   #FFFFFF;
    --shadow:   0 1px 2px rgba(0,0,0,.4), 0 8px 24px -12px rgba(0,0,0,.6);
  }

  * { box-sizing: border-box; }

  body {
    background: var(--ground);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 16.5px;
    line-height: 1.62;
    -webkit-font-smoothing: antialiased;
  }

  .wrap { max-width: 880px; margin: 0 auto; padding-inline: 20px; padding-block: 0 72px; }

  a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
  a:hover { color: var(--accent-2); }
  :focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; border-radius: 2px; }

  /* ---------- masthead ---------- */

  .masthead {
    display: flex; flex-direction: column; gap: 18px;
    padding-block: 60px 40px;
    border-bottom: 1px solid var(--line);
  }
  .role {
    font-family: var(--font-mono); font-size: 11px; font-weight: 700;
    letter-spacing: .16em; text-transform: uppercase; color: var(--faint);
    margin-bottom: -8px;
  }
  h1 {
    font-family: var(--font-display); font-weight: 700;
    font-size: clamp(34px, 7vw, 52px); letter-spacing: -.025em;
    line-height: 1.02; margin: 0; text-wrap: balance;
  }
  .lead {
    font-size: clamp(21px, 3.6vw, 27px); font-weight: 500;
    line-height: 1.3; letter-spacing: -.012em;
    margin: 0 0 20px; text-wrap: balance;
  }
  .meta, footer {
    display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px;
    font-family: var(--font-mono); font-size: 12.5px; color: var(--muted);
  }
  .meta span:not(:last-child)::after,
  footer span:not(:last-child)::after {
    content: "·"; margin-left: 10px; color: var(--line);
  }
  .meta a, footer a { text-decoration: none; }
  .meta a:hover, footer a:hover { text-decoration: underline; text-underline-offset: 3px; }

  /* ---------- actions ---------- */

.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }

.btn {
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1;
  padding: 9px 14px;
  border-radius: 4px;
  border: 1px solid var(--btn-bg);
  background: var(--btn-bg);
  color: var(--btn-fg);
  text-decoration: none;
  cursor: pointer;
}
.btn:hover { background: var(--btn-bg-h); border-color: var(--btn-bg-h); color: var(--btn-fg); }
.btn.ghost { background: transparent; color: var(--muted); border-color: var(--line); }
.btn.ghost:hover { background: transparent; color: var(--ink); border-color: var(--faint); }

  /* ---------- sections ---------- */

  section { padding-block: 44px 0; }
  .sec-label {
    font-family: var(--font-mono); font-size: 11px; font-weight: 700;
    letter-spacing: .16em; text-transform: uppercase; color: var(--faint);
    margin: 0 0 20px; display: flex; align-items: center; gap: 12px;
  }
  .sec-label::after { content: ""; flex: 1; height: 1px; background: var(--line); }

  /* text runs the full container width — the 880px wrap is the measure */
  .prose p { margin: 0 0 18px; }
  .prose p:last-child { margin-bottom: 0; }

  /* ---------- panel ---------- */

  .panel {
    background: var(--surface); border: 1px solid var(--line);
    border-radius: 5px; box-shadow: var(--shadow); overflow: hidden;
  }
  .panel-bar {
    display: flex; align-items: baseline; justify-content: space-between;
    gap: 16px; flex-wrap: wrap; padding: 11px 16px;
    background: var(--sunken); border-bottom: 1px solid var(--hairline);
    font-family: var(--font-mono); font-size: 13px;
  }
  .panel-bar .name { font-weight: 700; letter-spacing: -.01em; }
  .panel-bar .name a { text-decoration: none; }
  .panel-bar .name a:hover { text-decoration: underline; }
  .panel-bar .right { color: var(--faint); font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; }

  .panel-body { padding: 18px 16px 20px; }
  .panel-body > p { margin: 0 0 14px; }
  .panel-body > p:last-child { margin-bottom: 0; }

  .stack { display: flex; flex-direction: column; gap: 18px; }

  /* ---------- figures ---------- */

  figure { margin: 0 0 16px; }
  figure:last-child { margin-bottom: 0; }

  .shot {
    display: block; width: 100%; height: auto;
    border: 1px solid var(--hairline); border-radius: 4px;
    background: var(--sunken);
  }

  figcaption {
    font-family: var(--font-mono); font-size: 11px; line-height: 1.5;
    color: var(--faint); margin-top: 8px; letter-spacing: .02em;
  }

  .shot-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
  @media (min-width: 700px) { .shot-grid.two { grid-template-columns: 1fr 1fr; } }
  .shot-grid.pair { align-items: start; }
  @media (min-width: 620px) { .shot-grid.pair { grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); } }
  .shot-grid.pair .shot { margin-inline: auto; }

  /* placeholder frame — also the fallback when a remote image can't load */
  .ph {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 6px; text-align: center; padding: 20px;
    aspect-ratio: 16 / 10;
    border: 1px dashed var(--line); border-radius: 4px;
    background: var(--sunken); color: var(--faint);
    font-family: var(--font-mono); font-size: 11.5px; line-height: 1.6;
  }
  .ph.phone { aspect-ratio: 10 / 16; max-width: 260px; }
  .ph b { display: block; color: var(--muted); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; }
  .ph .dim { font-size: 10.5px; opacity: .85; }

  /* ---------- code ---------- */

  pre {
    font-family: var(--font-mono); font-size: 12.5px; line-height: 1.75;
    margin: 0; padding: 14px 16px;
    background: var(--sunken); border: 1px solid var(--hairline);
    border-radius: 4px; overflow-x: auto; color: var(--ink);
  }
  pre .c { color: var(--faint); }
  pre .s { color: var(--accent); }
  pre .k { color: var(--muted); font-weight: 700; }
  code { font-family: var(--font-mono); font-size: .88em; }

  .compare { display: grid; grid-template-columns: 1fr; gap: 12px; }
  @media (min-width: 720px) { .compare { grid-template-columns: 1fr 1fr; } }
  .compare h4, .code-label {
    font-family: var(--font-mono); font-size: 11px; font-weight: 700;
    letter-spacing: .12em; text-transform: uppercase; color: var(--faint);
    margin: 0 0 8px;
  }

  /* ---------- case study ---------- */

  .case { border-top: 1px solid var(--hairline); margin-top: 18px; padding-top: 16px; }
  .case dl { margin: 0; display: grid; grid-template-columns: 1fr; gap: 14px; }
  @media (min-width: 640px) { .case dl { grid-template-columns: 108px 1fr; gap: 10px 18px; } }
  .case dt {
    font-family: var(--font-mono); font-size: 10.5px; font-weight: 700;
    letter-spacing: .12em; text-transform: uppercase; color: var(--faint);
    padding-top: 5px;
  }
  .case dd { margin: 0; font-size: 16px; line-height: 1.55; }
  .case dd:last-of-type { color: var(--muted); }

  /* ---------- theme demo ---------- */

  .themebar { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
  .themebtn {
    font-family: var(--font-mono); font-size: 11.5px; padding: 5px 11px;
    border-radius: 3px; border: 1px solid var(--line);
    background: var(--surface); color: var(--muted); cursor: pointer;
    transition: border-color .15s, color .15s;
  }
  .themebtn:hover { color: var(--ink); border-color: var(--faint); }

  .roles { display: flex; flex-wrap: wrap; gap: 8px; }
  .chip {
    font-family: var(--font-mono); font-size: 11.5px; font-weight: 500;
    padding: 6px 12px; border-radius: 3px; color: #fff;
    transition: background-color .2s ease;
  }
  .bar-demo { margin-top: 14px; height: 9px; border-radius: 999px; background: var(--hairline); overflow: hidden; }
  .bar-demo > i {
    display: block; height: 100%; width: 62%; border-radius: 999px;
    background-image: linear-gradient(45deg, rgba(255,255,255,.22) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.22) 50%, rgba(255,255,255,.22) 75%, transparent 75%);
    background-size: 14px 14px; transition: background-color .2s ease;
  }

  /* ---------- work ---------- */

  .role-row {
    display: flex; justify-content: space-between; align-items: baseline;
    gap: 14px; flex-wrap: wrap; padding-block: 10px;
    border-bottom: 1px solid var(--hairline);
  }
  .role-row:last-of-type { border-bottom: 0; }
  .tenure { margin-top: 20px; border-top: 1px solid var(--hairline); }
  .tenure-label {
    font-family: var(--font-mono); font-size: 10px; font-weight: 700;
    letter-spacing: .14em; text-transform: uppercase; color: var(--faint);
    margin: 12px 0 2px;
  }
  .role-row .t { font-family: var(--font-display); font-weight: 600; font-size: 15px; }
  .role-row .d { font-family: var(--font-mono); font-size: 11.5px; color: var(--faint); font-variant-numeric: tabular-nums; white-space: nowrap; }

  .tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
  .tag {
    font-family: var(--font-mono); font-size: 11px; letter-spacing: .04em;
    padding: 4px 9px; border: 1px solid var(--line); border-radius: 3px; color: var(--muted);
  }

  .stats { display: flex; flex-wrap: wrap; border-top: 1px solid var(--hairline); background: var(--sunken); }
  .stat { flex: 1 1 120px; padding: 12px 16px; border-right: 1px solid var(--hairline); }
  .stat:last-child { border-right: 0; }
  .stat .num {
    font-family: var(--font-display); font-weight: 700; font-size: 19px;
    letter-spacing: -.02em; font-variant-numeric: tabular-nums; display: block;
  }
  .stat .cap {
    font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .1em;
    text-transform: uppercase; color: var(--faint);
  }

  footer { margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--line); }

  @media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
