/* Icarian Forge — Dan West's portfolio.
   Layout: one editorial column with a wide work section; project pages read like short case studies.
   Light by default, dark when the device asks for it. One ember accent, used for links and the sun in the mark. */

:root {
  --paper: #f6f6f3;
  --card: #ffffff;
  --ink: #141413;
  --mute: #5f5e58;
  --faint: #8a8981;
  --line: rgba(20, 20, 19, 0.12);
  --line-strong: rgba(20, 20, 19, 0.24);
  --accent: #c2410c;          /* ember */
  --accent-soft: rgba(194, 65, 12, 0.08);
  --accent-on-ink: #f97343;   /* the accent on the inverted contact card */
  --shadow: 0 1px 2px rgba(20, 20, 19, 0.06), 0 12px 32px -16px rgba(20, 20, 19, 0.18);

  --font-display: 'Bricolage Grotesque', 'Helvetica Neue', Arial, sans-serif;
  --font-body: 'Geist', system-ui, -apple-system, sans-serif;
  --font-mono: 'Geist Mono', ui-monospace, 'SF Mono', monospace;
  --font-wit: 'Instrument Serif', Georgia, serif;   /* the quiet italic for a turn of phrase */

  --wide: 1120px;
  --text: 680px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #111110;
    --card: #1a1a18;
    --ink: #edece8;
    --mute: #a3a29b;
    --faint: #7c7b74;
    --line: rgba(237, 236, 232, 0.12);
    --line-strong: rgba(237, 236, 232, 0.24);
    --accent: #f97343;
    --accent-soft: rgba(249, 115, 67, 0.1);
    --accent-on-ink: #c2410c;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 16px 40px -18px rgba(0, 0, 0, 0.7);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 80px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { background: var(--paper); color: var(--ink); font: 400 1.0625rem/1.6 var(--font-body); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration-color: var(--line-strong); text-underline-offset: 4px; text-decoration-thickness: 1px; }
a:hover { text-decoration-color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; padding: 8px 14px; background: var(--ink); color: var(--paper); }
.skip:focus { left: 8px; }
.wrap { width: 100%; max-width: var(--wide); margin: 0 auto; padding-inline: 24px; }
.mono { font-family: var(--font-mono); font-size: 0.8125rem; letter-spacing: 0.02em; }

/* ---------- Top bar ---------- */
.top { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid transparent; transition: border-color 0.2s; }
.top.scrolled { border-bottom-color: var(--line); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }
.mark { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font: 600 1.05rem/1 var(--font-display); letter-spacing: -0.01em; }
.mark svg { width: 28px; height: 28px; flex: none; }
.mark .sun { fill: var(--accent); }
.mark .forge { color: var(--accent); }
.top nav { display: flex; gap: 4px; }
.top nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; text-decoration: none; color: var(--mute); font-size: 0.95rem; border-radius: 8px; }
.top nav a:hover { color: var(--ink); }

/* ---------- Landing ---------- */
.hero { padding-block: clamp(56px, 10vw, 120px) clamp(48px, 7vw, 88px); }
.eyebrow { color: var(--mute); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.eyebrow .dot { width: 8px; height: 8px; border-radius: 50%; background: #22a35a; box-shadow: 0 0 0 4px rgba(34, 163, 90, 0.14); }
.hero h1 { margin-top: 22px; max-width: 19ch; font: 600 clamp(3rem, 8vw, 5.6rem)/1 var(--font-display); letter-spacing: -0.03em; text-wrap: balance; }
.hero h1 em { font: italic 400 0.5em/1 var(--font-wit); letter-spacing: 0.005em; color: var(--accent); white-space: nowrap; } /* small print, set small */
.hero p.lede { margin-top: 28px; max-width: 58ch; color: var(--mute); font-size: clamp(1.05rem, 1.6vw, 1.2rem); }
.cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 32px; }
.btn { display: inline-flex; align-items: center; gap: 8px; min-height: 46px; padding: 0 20px; border-radius: 999px; border: 1px solid var(--line-strong); text-decoration: none; font-weight: 500; font-size: 0.97rem; transition: border-color 0.15s, background 0.15s, transform 0.15s; }
.btn:hover { border-color: var(--ink); }
.btn.solid { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn.solid:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn .arrow { transition: transform 0.15s; }
.creds { list-style: none; padding: 0; margin-top: 28px; display: flex; flex-wrap: wrap; gap: 8px 22px; color: var(--mute); }
.creds li { display: inline-flex; align-items: center; gap: 8px; }
.creds li::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
footer a { text-decoration: none; }
footer a:hover { color: var(--ink); }
.btn:hover .arrow { transform: translateX(2px); }

section { scroll-margin-top: 72px; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding-top: 28px; border-top: 1px solid var(--line-strong); }
.sec-head h2 { font: 600 1.6rem/1.15 var(--font-display); letter-spacing: -0.02em; }
.sec-head .mono { color: var(--faint); }

/* work */
.work { padding-block: 24px 96px; }
.projects { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-top: 28px; }
.project { position: relative; display: flex; flex-direction: column; border-radius: 18px; background: var(--card); border: 1px solid var(--line); overflow: hidden; box-shadow: var(--shadow); transition: transform 0.2s ease, border-color 0.2s; }
.project.featured { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
a.project { text-decoration: none; }
a.project:hover { transform: translateY(-3px); border-color: var(--line-strong); }
@media (prefers-reduced-motion: reduce) { a.project:hover { transform: none; } }
.shot { position: relative; background: #17120d; aspect-ratio: 16 / 10; overflow: hidden; }
.project.featured .shot { aspect-ratio: auto; min-height: 100%; }
/* The Unlisted's tile: web, phone and share card as three separate pieces on a warm backdrop, each with its own depth */
.stage { --stage-a: #e9dcc5; --stage-b: #c9b08a; background: radial-gradient(120% 90% at 20% 10%, var(--stage-a), var(--stage-b)); min-height: 340px; }
@media (prefers-color-scheme: dark) { .stage { --stage-a: #6e5639; --stage-b: #2b2118; } }
.stage::before { content: ''; position: absolute; inset: 0; opacity: 0.35; background: repeating-radial-gradient(circle at 85% 110%, transparent 0 22px, rgba(255, 255, 255, 0.07) 22px 23px); }
.device { position: absolute; margin: 0; overflow: hidden; background: #15110c; transition: transform 0.45s cubic-bezier(0.2, 0.7, 0.2, 1); }
.stage .device img { width: 100%; height: auto; object-fit: initial; transition: none; }
.device.web { left: 7%; top: 9%; width: 76%; border-radius: 10px; box-shadow: 0 0 0 1px rgba(255, 240, 215, 0.12), 0 2px 4px rgba(0, 0, 0, 0.12), 0 24px 48px -12px rgba(40, 24, 8, 0.45); z-index: 1; }
.device.web .chrome { display: flex; align-items: center; gap: 5px; height: 22px; padding: 0 10px; background: #251d15; border-bottom: 1px solid rgba(255, 255, 255, 0.06); }
.device.web .chrome i { width: 7px; height: 7px; border-radius: 50%; background: rgba(238, 226, 200, 0.25); }
.device.web .chrome span { margin-left: 10px; font: 500 9px var(--font-mono); color: rgba(238, 226, 200, 0.55); letter-spacing: 0.02em; white-space: nowrap; overflow: hidden; }
.device.card { left: 4%; bottom: 7%; width: 40%; border-radius: 8px; transform: rotate(-3deg); box-shadow: 0 0 0 1px rgba(255, 240, 215, 0.14), 0 2px 4px rgba(0, 0, 0, 0.15), 0 22px 40px -14px rgba(30, 18, 6, 0.6); z-index: 2; }
.device.phone { right: 6%; bottom: 6%; width: 21%; border-radius: 22px; transform: rotate(3deg); border: 5px solid #0d0a07; box-shadow: 0 0 0 1px rgba(255, 240, 215, 0.16), 0 2px 4px rgba(0, 0, 0, 0.2), 0 30px 50px -14px rgba(30, 18, 6, 0.7); z-index: 3; }
a.project:hover .device.web { transform: translateY(-4px); }
a.project:hover .device.card { transform: rotate(-3deg) translateY(-7px); }
a.project:hover .device.phone { transform: rotate(3deg) translateY(-10px); }
@media (prefers-reduced-motion: reduce) { .device { transition: none; } a.project:hover .device.web { transform: none; } a.project:hover .device.card { transform: rotate(-3deg); } a.project:hover .device.phone { transform: rotate(3deg); } }
.shot img { width: 100%; height: 100%; object-fit: cover; object-position: top center; transition: transform 0.5s ease; }
a.project:hover .shot:not(.stage) img { transform: scale(1.02); }
@media (prefers-reduced-motion: reduce) { a.project:hover .shot img { transform: none; } }
.body { display: flex; flex-direction: column; gap: 12px; padding: 28px; min-width: 0; }
.project.featured .body { padding: clamp(28px, 4vw, 44px); justify-content: center; }
.status { display: inline-flex; align-items: center; gap: 8px; align-self: flex-start; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--mute); }
.status::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.status.live::before { background: #22a35a; }
.status.forge::before { background: var(--accent); }
.project h3 { font: 700 clamp(1.5rem, 2.6vw, 2.1rem)/1.1 var(--font-display); letter-spacing: -0.025em; }
.project p { color: var(--mute); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; }
.tags li { padding: 3px 9px; border-radius: 6px; background: var(--accent-soft); color: var(--ink); }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding-top: 14px; margin-top: 4px; border-top: 1px solid var(--line); }
.facts b { display: block; font: 700 1.35rem/1.1 var(--font-display); letter-spacing: -0.02em; color: var(--ink); font-variant-numeric: tabular-nums; }
.facts span { color: var(--mute); font-size: 0.85rem; line-height: 1.35; display: block; margin-top: 2px; }
.more { margin-top: 6px; display: inline-flex; align-items: center; gap: 6px; font-weight: 500; color: var(--ink); }
.more .arrow { color: var(--accent); transition: transform 0.15s; }
a.project:hover .more .arrow { transform: translateX(3px); }
/* placeholder art for projects still in the forge */
.forge-art { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: var(--paper); border-bottom: 1px solid var(--line); }
.forge-art::before { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(-45deg, transparent 0 14px, var(--line) 14px 15px); }
.forge-art::after { content: ''; position: absolute; left: 50%; top: 50%; width: 46%; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%; background: radial-gradient(circle at 50% 50%, var(--accent-soft), transparent 70%); }
.forge-art span { position: absolute; inset: 0; display: grid; place-items: center; z-index: 1; color: var(--faint); }
.project.placeholder { box-shadow: none; }

/* about */
.about { padding-block: 24px 96px; }
.about-grid { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: clamp(28px, 6vw, 80px); margin-top: 28px; }
.about-grid .lead { font: 600 clamp(1.4rem, 2.6vw, 1.9rem)/1.25 var(--font-display); letter-spacing: -0.02em; text-wrap: balance; }
.prose { display: grid; gap: 1em; max-width: var(--text); }
.prose p { color: var(--ink); }
.prose .soft { color: var(--mute); }
.principles { list-style: none; padding: 0; margin-top: 32px; display: grid; gap: 0; border-top: 2px solid var(--ink); }
.principles li { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 8px 24px; padding: 20px 0; border-bottom: 1px solid var(--line-strong); }
.principles b { font: 600 1.05rem/1.35 var(--font-display); letter-spacing: -0.01em; }
.principles span { color: var(--mute); }

/* contact */
.contact { padding-block: 24px 120px; }
.contact-card { margin-top: 28px; padding: clamp(28px, 5vw, 56px); border-radius: 22px; background: var(--ink); color: var(--paper); display: grid; gap: 18px; }
.contact-card h3 { font: 700 clamp(1.8rem, 4.5vw, 3.2rem)/1.05 var(--font-display); letter-spacing: -0.03em; max-width: 18ch; text-wrap: balance; }
.contact-card h3 em { font: italic 400 0.62em/1 var(--font-wit); color: var(--accent-on-ink); white-space: nowrap; }
.contact-card p { color: color-mix(in srgb, var(--paper) 72%, transparent); max-width: 52ch; }
.contact-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.contact-card .btn { border-color: color-mix(in srgb, var(--paper) 30%, transparent); color: var(--paper); }
.contact-card .btn:hover { border-color: var(--paper); }
.contact-card .btn.solid { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.contact-card .btn.solid:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.email { font-family: var(--font-mono); font-size: 0.95rem; user-select: all; }
.copied { color: color-mix(in srgb, var(--paper) 72%, transparent); font-size: 0.9rem; min-height: 1.4em; }

footer { border-top: 1px solid var(--line); }
footer .wrap { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-block: 28px 40px; color: var(--faint); }

/* ---------- Case study ---------- */
.case-head { padding-block: clamp(40px, 8vw, 88px) 36px; }
.back { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; color: var(--mute); text-decoration: none; }
.back:hover { color: var(--ink); }
.case-head h1 { margin-top: 18px; font: 700 clamp(2.8rem, 8vw, 5.6rem)/1 var(--font-display); letter-spacing: -0.04em; }
.case-head .lede { margin-top: 18px; max-width: 46ch; color: var(--mute); font-size: clamp(1.1rem, 1.8vw, 1.3rem); text-wrap: pretty; }
.meta { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--line); }
.meta dt { color: var(--faint); }
.meta dd { margin-top: 6px; font-size: 0.97rem; }
.figure { margin-block: 8px 0; }
.figure .frame { border-radius: 18px; overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow); background: #17120d; }
.figure figcaption { margin-top: 12px; color: var(--faint); }
.chapter { display: grid; grid-template-columns: minmax(0, 0.7fr) minmax(0, 1.3fr); gap: clamp(20px, 5vw, 64px); padding-block: 56px; border-top: 1px solid var(--line); }
.chapter:first-of-type { border-top: 0; }
.chapter h2 { font: 600 1.55rem/1.2 var(--font-display); letter-spacing: -0.02em; text-wrap: balance; }
.chapter .mono { color: var(--faint); display: block; margin-bottom: 8px; }
.steps { list-style: none; padding: 0; display: grid; gap: 0; counter-reset: step; border-top: 1px solid var(--line); }
.steps li { counter-increment: step; display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 4px 12px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.steps li::before { content: counter(step); grid-row: span 2; font: 600 0.85rem var(--font-mono); color: var(--accent); padding-top: 3px; }
ul.steps li { grid-template-columns: 20px minmax(0, 1fr); }
ul.steps li::before { content: ''; width: 7px; height: 7px; margin-top: 9px; border-radius: 50%; background: var(--accent); }
.steps b { font-weight: 600; }
.steps span { color: var(--mute); }
.stat-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 8px; }
.stat { padding: 18px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); }
.stat b { display: block; font: 700 1.9rem/1 var(--font-display); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.stat span { display: block; margin-top: 6px; color: var(--mute); font-size: 0.9rem; line-height: 1.35; }
.timeline { list-style: none; padding: 0; display: grid; gap: 0; border-left: 2px solid var(--line); margin-left: 6px; }
.timeline li { position: relative; padding: 0 0 22px 22px; }
.timeline li::before { content: ''; position: absolute; left: -7px; top: 7px; width: 12px; height: 12px; border-radius: 50%; background: var(--paper); border: 2px solid var(--line-strong); }
.timeline li:last-child::before { background: var(--accent); border-color: var(--accent); }
.timeline b { display: block; font-weight: 600; }
.timeline span { color: var(--mute); }
.gallery { display: grid; grid-template-columns: minmax(0, 2.4fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.gallery .frame img { width: 100%; }
.next { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding-block: 40px 96px; border-top: 1px solid var(--line); }

/* ---------- Narrow screens ---------- */
@media (max-width: 860px) {
  .projects { grid-template-columns: minmax(0, 1fr); }
  .project.featured { grid-template-columns: minmax(0, 1fr); }
  .project.featured .shot { aspect-ratio: 16 / 10; min-height: 0; }
  .about-grid, .chapter { grid-template-columns: minmax(0, 1fr); }
  .meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .principles li { grid-template-columns: minmax(0, 1fr); }
  .gallery { grid-template-columns: minmax(0, 1fr); }
  .gallery .frame:last-child { max-width: 320px; }
}
@media (max-width: 560px) {
  .wrap { padding-inline: 16px; }
  .top nav a { padding: 0 8px; }
  .top nav a.hide-sm { display: none; }
  .facts, .stat-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .facts div:last-child, .stat-row .stat:last-child { grid-column: 1 / -1; }
  .body { padding: 22px; }
}
