/* No Work Labs — dark, code-flavoured identity.
   Ideology (not imitation): one thing per screen, the work is the hero,
   restraint over decoration, obsessive spacing & type. */

:root {
  /* "Terminal" is the brand font — embedded via @font-face once its file is added.
     Falls back to a monospace until then. */
  --font: "Terminal", "Courier New", monospace;
  --mono: "Terminal", "Courier New", monospace;

  --bg:      #161616;   /* the games' black — one background everywhere */
  --bg-2:    #1e1e1e;   /* cards / sections, a touch lighter */
  --bg-3:    #262628;   /* inputs / code */
  --ink:     #f4f4f6;
  --ink-soft:#a2a2a8;
  --ink-faint:#6d6d73;
  --line:    rgba(255,255,255,.10);
  --line-2:  rgba(255,255,255,.06);
  --accent:  #4fe3b0;      /* mint — our colour, not apple blue */
  --accent-2:#3bc79a;
  --accent-ink:#04140d;

  --nav-h: 60px;
  --maxw: 1080px;
  --radius: 16px;
  --ease: cubic-bezier(.33,.1,.25,1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip; /* nothing pushes the page wider than the screen */
  font-size: 15px;
}
button, input, select, textarea { font-family: inherit; } /* controls don't inherit by default */
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-2); }
img, svg { max-width: 100%; display: block; }
::selection { background: var(--accent); color: var(--accent-ink); }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ---------- Nav ---------- */
.nav {
  position: relative; z-index: 100; height: var(--nav-h);
  background: transparent; /* in-flow + transparent: no bar, no line; it scrolls away on long pages */
}
.nav.overlay { position: fixed; top: 0; left: 0; right: 0; background: transparent; } /* home: fixed over the game */
.nav-inner { max-width: var(--maxw); margin: 0 auto; height: 100%; padding: 0 24px;
  display: flex; align-items: center; gap: 28px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink);
  font-family: var(--mono); font-weight: 600; font-size: 15px; letter-spacing: .02em; }
.brand:hover { color: var(--ink); }
.brand .braces { color: var(--accent); }
.brand img { height: 22px; width: auto; opacity: .95; }
.nav-links { margin-left: auto; display: flex; gap: 30px; align-items: center; }
.nav-links a { color: var(--ink-soft); font-size: 14px; letter-spacing: .01em; transition: color .2s var(--ease); }
.nav-links a:hover, .nav-links a.active { color: var(--ink); }
.nav-toggle { display: none; margin-left: auto; background: none; border: 0; color: var(--ink); font-size: 22px; cursor: pointer; }
@media (max-width: 720px) {
  .nav-links { position: fixed; inset: var(--nav-h) 0 auto 0; flex-direction: column; gap: 0;
    background: rgba(22,22,22,.97); backdrop-filter: blur(16px);
    padding: 6px 0; margin-left: 0;
    transform: translateY(-120%); opacity: 0; visibility: hidden; pointer-events: none;
    transition: transform .35s var(--ease), opacity .2s var(--ease), visibility .35s; }
  .nav-links.open { transform: translateY(0); opacity: 1; visibility: visible; pointer-events: auto; }
  .nav-links a { padding: 15px 24px; width: 100%; font-size: 16px; border-bottom: 1px solid var(--line-2); }
  .nav-links a:last-child { border-bottom: 0; }
  .nav-toggle { display: block; }
}

/* ---------- Home: full-bleed game ---------- */
html.home, body.home { height: 100%; overflow: hidden; }
.game-frame { position: fixed; inset: 0; width: 100%; height: 100%; border: 0; background: var(--bg); }

/* ---------- One-screen (no-scroll) inner pages ---------- */
.screen { min-height: calc(100dvh - var(--nav-h)); display: flex; flex-direction: column;
  justify-content: center; gap: clamp(16px, 3vh, 32px); padding-block: clamp(14px, 2.5vh, 32px); }
.wrap.wide { max-width: 1340px; } /* Experiments: use the room */
.contact-layout { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(30px, 6vw, 88px); align-items: center; }
.contact-layout .form { max-width: none; }
.contact-layout .field { margin-bottom: 15px; }
@media (max-width: 820px) { .contact-layout { grid-template-columns: 1fr; gap: 26px; } }
/* phones: keep everything within one screen — compact, centred, no scroll */
@media (max-width: 720px) {
  .screen { padding-block: 14px; gap: 12px; justify-content: flex-start; }
  /* big cards — lots of room on mobile; swipe sideways for more */
  .hscroll .card { width: min(90vw, 420px); }
  .hscroll .card .card-media { aspect-ratio: 4 / 3; }
  .hscroll .card .card-body { padding: 24px 22px 26px; }
  .hscroll .card .card-body h3 { font-size: 23px; margin: 12px 0 10px; }
  .hscroll .card .card-body p { font-size: 16px; line-height: 1.55; }
  .hscroll .card .card-foot { margin-top: 20px; font-size: 16px; }
  /* Experiments: one card fills the view, next card peeks ~10-15% — stays within the side padding */
  .hscroll.exp .card { width: 74vw; }
  /* compact contact form so it fits without scrolling */
  .contact-intro .lead { font-size: 12px; margin-top: 10px; }
  .field { margin-bottom: 10px; }
  .field label { margin-bottom: 5px; }
  .field input, .field select, .field textarea { padding: 10px 12px; font-size: 14px; }
  .field textarea { min-height: 58px; }
  .form .btn-primary { padding: 12px; }
  /* mobile sits closer to the eye — shrink secondary text, keep headings prominent */
  .display { font-size: clamp(32px, 9.5vw, 48px); }
  .h2 { font-size: clamp(27px, 7.6vw, 40px); }
  .lead { font-size: 16px; line-height: 1.5; }
  .eyebrow { font-size: 12px; }
  .prose h2 { font-size: 20px; }
  .prose p, .prose ol, .prose ul { font-size: 14px; }
  .prose li { margin-bottom: 6px; }
  .prose code, code.inline { font-size: 12px; padding: 1px 5px; }
  .card-body p, .feature p { font-size: 13px; }
  .card-body h3, .feature h3 { font-size: 17px; }
  .feature { padding: 20px; }
  .field input, .field select, .field textarea { font-size: 15px; }
  .detail-hero h1 { font-size: clamp(28px, 8vw, 40px); }
  .detail-hero .glyph { font-size: 44px; }
  .brand { font-size: 13px; }
  .brand img { height: 20px; }
  .nav-links a { font-size: 16px; }
}
.grid.compact { gap: 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.grid.compact .card-media { aspect-ratio: 16/7; font-size: 32px; }
.grid.compact .card-body { padding: 18px 20px; }
.grid.compact .card-body h3 { font-size: 18px; margin: 8px 0 6px; }
.grid.compact .card-body p { font-size: 13.5px; line-height: 1.45; }
.grid.compact .card-foot { margin-top: 12px; font-size: 13px; }

/* ---------- Typography ---------- */
.eyebrow { font-family: var(--mono); color: var(--accent); font-size: 13px;
  letter-spacing: .08em; text-transform: uppercase; }
h1, h2, h3 { letter-spacing: -.02em; line-height: 1.08; font-weight: 600; }
.display { font-size: clamp(30px, 4.8vw, 60px); font-weight: 600; letter-spacing: -.03em; }
.h2 { font-size: clamp(24px, 3.8vw, 46px); }
.lead { font-size: clamp(15px, 1.6vw, 21px); color: var(--ink-soft); line-height: 1.5; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 13px 24px;
  border-radius: 12px; font-size: 15px; font-weight: 500; border: 1px solid transparent;
  cursor: pointer; transition: all .2s var(--ease); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-2); color: var(--accent-ink); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--ink-soft); color: var(--ink); }
.btn-outline { background: var(--bg-3); color: var(--ink); border-color: var(--line); }
.btn-outline:hover { background: #202024; color: var(--ink); }

/* ---------- Sections ---------- */
section { padding: clamp(60px, 11vw, 120px) 0; }
.section-head { max-width: 720px; margin: 0 auto 52px; }
.section-head .lead { margin-top: 16px; }
.inner-hero { padding: clamp(90px, 13vw, 150px) 0 clamp(20px, 5vw, 48px); }
.inner-hero .display { margin: 14px 0 0; max-width: 16ch; }
.inner-hero .lead { margin-top: 20px; max-width: 52ch; }

/* ---------- Cards / grid ---------- */
.grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.card { display: flex; flex-direction: column; background: var(--bg-2);
  border: 1px solid var(--line-2); border-radius: var(--radius); overflow: hidden; color: var(--ink);
  transition: transform .3s var(--ease), border-color .3s var(--ease); }
.card:hover { transform: translateY(-4px); border-color: var(--line); color: var(--ink); }
.card-media { aspect-ratio: 16/10; background: radial-gradient(120% 120% at 50% 0%, #1b1b1f 0%, #0d0d0f 100%);
  display: grid; place-items: center; font-size: 46px; border-bottom: 1px solid var(--line-2); overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 24px; }
.card-tag { font-family: var(--mono); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.card-body h3 { font-size: 21px; margin: 10px 0 8px; }
.card-body p { color: var(--ink-soft); font-size: 15px; }
.card-foot { margin-top: 16px; font-size: 14px; color: var(--accent); font-weight: 500; display: flex; align-items: center; gap: 4px; }
.card-foot::after { content: "→"; transition: transform .2s var(--ease); }
.card:hover .card-foot::after { transform: translateX(4px); }
.card[data-soon] { opacity: .6; }
.badge-soon { display: inline-block; font-family: var(--mono); font-size: 11px; letter-spacing: .06em;
  text-transform: uppercase; color: var(--ink-soft); background: var(--bg-3); border: 1px solid var(--line-2);
  padding: 4px 10px; border-radius: 999px; }

/* ---------- Detail pages ---------- */
.detail-hero { padding: clamp(96px,13vw,150px) 0 clamp(24px,5vw,48px); }
.detail-hero .glyph { font-size: 60px; margin-bottom: 8px; }
.detail-hero .card-tag { display: inline-block; }
.detail-hero h1 { font-size: clamp(34px,5vw,58px); margin: 10px 0 16px; }
.detail-hero .lead { max-width: 60ch; }
.detail-cover { max-width: 760px; margin: 36px auto 0; border-radius: var(--radius);
  overflow: hidden; border: 1px solid var(--line-2); background: var(--bg-2); }
.detail-cover img { width: 100%; display: block; }
.detail-actions { margin-top: 30px; display: flex; gap: 12px; flex-wrap: wrap; }
.feature-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(250px,1fr)); }
.feature { background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--radius); padding: 26px; }
.feature .fi { font-size: 28px; }
.feature h3 { font-size: 18px; margin: 12px 0 8px; }
.feature p { color: var(--ink-soft); font-size: 15px; }
.prose { max-width: 680px; padding: 0 24px; margin: 0 auto; }
.prose h2 { font-size: 26px; margin: 0 0 16px; }
.prose p, .prose ol, .prose ul { color: var(--ink-soft); font-size: 16px; margin-bottom: 16px; }
.prose ol, .prose ul { margin-left: 22px; }
.prose li { margin-bottom: 8px; }
.prose code, code.inline { font-family: var(--mono); font-size: 13px; background: var(--bg-3);
  border: 1px solid var(--line-2); border-radius: 6px; padding: 2px 7px; color: var(--ink);
  overflow-wrap: anywhere; word-break: break-word; }
.back-link { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 13px; color: var(--ink-soft); }
.back-link:hover { color: var(--ink); }
.back-link::before { content: "←"; }

/* ---------- Forms ---------- */
.form { max-width: 620px; }
.field { margin-bottom: 20px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field-row .field { margin-bottom: 20px; }
.field label { display: block; font-family: var(--mono); font-size: 12px; letter-spacing: .04em;
  text-transform: uppercase; color: var(--ink-soft); margin-bottom: 8px; }
.field input, .field select, .field textarea { width: 100%; font: inherit; font-size: 16px; color: var(--ink);
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease); }
.field textarea { resize: vertical; min-height: 90px; }
.field input::placeholder, .field textarea::placeholder { color: var(--ink-faint); }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(79,227,176,.15); }
.field select { appearance: none; padding-right: 42px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1.5l6 6 6-6' stroke='%23a2a2a8' stroke-width='1.7' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 16px center; }
.form .btn-primary { width: 100%; justify-content: center; padding: 15px; font-size: 16px; }
.form-status { margin-top: 18px; font-size: 15px; min-height: 1.4em; }
.form-status.ok { color: var(--accent); }
.form-status.err { color: #ff6b6b; }
.hp { position: absolute; left: -9999px; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line-2); padding: 36px 0; font-size: 13px; color: var(--ink-faint); }
.footer .wrap { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between; }
.footer a { color: var(--ink-soft); }
.footer a:hover { color: var(--ink); }
.footer .mono { font-family: var(--mono); }

/* ---------- Tabs (project pages) ---------- */
.tabs { display: flex; flex-direction: column; min-height: 0; }
.tab-btns { display: flex; gap: 2px; border-bottom: 1px solid var(--line-2); overflow-x: auto; }
.tab-btn { font: inherit; font-size: 13px; letter-spacing: .02em; color: var(--ink-soft);
  background: none; border: 0; border-bottom: 2px solid transparent; padding: 10px 16px;
  cursor: pointer; white-space: nowrap; transition: color .2s var(--ease), border-color .2s var(--ease); }
.tab-btn:hover { color: var(--ink); }
.tab-btn.active { color: var(--ink); border-bottom-color: var(--accent); }
.tab-panel { display: none; padding-top: 20px; }
.tab-panel.active { display: block; }

/* ---------- Horizontal scroller (cards / features) ---------- */
.hscroll { display: flex; gap: 14px; overflow-x: auto; overflow-y: hidden; padding-bottom: 12px;
  scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; }
.hscroll > * { flex: 0 0 auto; scroll-snap-align: start; }
.hscroll .card { width: 250px; }
.hscroll .feature { width: 230px; }
.hscroll::-webkit-scrollbar { height: 6px; }
.hscroll::-webkit-scrollbar-thumb { background: var(--line); border-radius: 3px; }

/* ---------- Project (detail) page as one screen ---------- */
.detail { display: flex; flex-direction: column; gap: 16px; padding-top: 8px; padding-bottom: 24px; }
.detail-top .card-tag { display: inline-block; }
.detail-top h1 { font-size: clamp(24px, 4vw, 38px); margin: 8px 0 10px; letter-spacing: -.02em; }
.detail-top .lead { max-width: 62ch; }
.detail-top .detail-actions { margin-top: 16px; display: flex; gap: 10px; flex-wrap: wrap; }
.tab-cover { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line-2); max-width: 720px; }
.tab-cover img { width: 100%; display: block; }
.prose.tab-prose { padding: 0; max-width: 680px; margin: 0; } /* left-align under the tabs, not centred */

/* Experiments: a real grid on desktop (all cards visible), swipe cards on mobile */
@media (min-width: 721px) {
  .hscroll.exp { display: grid; grid-template-columns: repeat(4, 1fr); overflow: visible; gap: 20px; }
  .hscroll.exp > * { width: auto; }
  .hscroll.exp .card-media { aspect-ratio: 4 / 3; }
  .hscroll.exp .card-body { padding: 22px 22px 24px; }
  .hscroll.exp .card-body h3 { font-size: 22px; }
  .hscroll.exp .card-body p { font-size: 15px; }
  /* bigger form on desktop — there's room */
  .field input, .field select, .field textarea { font-size: 17px; padding: 16px 18px; }
  .field label { font-size: 13px; }
}

/* ---------- Scroll reveal ---------- */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } html { scroll-behavior: auto; } }
