/* DotYou Studios - shared styles */
@font-face { font-family: "Space Grotesk"; font-weight: 400; font-display: swap; src: url("fonts/space-grotesk-400.woff2") format("woff2"); }
@font-face { font-family: "Space Grotesk"; font-weight: 500; font-display: swap; src: url("fonts/space-grotesk-500.woff2") format("woff2"); }
@font-face { font-family: "Space Grotesk"; font-weight: 700; font-display: swap; src: url("fonts/space-grotesk-700.woff2") format("woff2"); }
@font-face { font-family: "Space Mono"; font-weight: 400; font-display: swap; src: url("fonts/space-mono-400.woff2") format("woff2"); }
@font-face { font-family: "Space Mono"; font-weight: 700; font-display: swap; src: url("fonts/space-mono-700.woff2") format("woff2"); }

:root {
  --bg: #000;
  --fg: #fff;
  --text: #d6d6d6;
  --muted: #7d7d7d;
  --line: #1c1c1c;
  --line-strong: #2e2e2e;
  --font: "Space Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Space Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
::selection { background: #fff; color: #000; }
/* logo & visuals: not selectable, draggable or long-press-savable (see assets/protect.js) */
svg, canvas, img, .mark, .wordmark, #view, .static { -webkit-user-select: none; user-select: none; -webkit-user-drag: none; -webkit-touch-callout: none; }
a { color: var(--fg); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; transition: text-decoration-color .2s; }
a:hover { text-decoration-color: var(--fg); }
:focus-visible { outline: 2px solid #fff; outline-offset: 4px; border-radius: 2px; }

/* ---------- Home ---------- */
.home {
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  display: grid;
  place-items: center;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.home::before { /* faint isometric grid that fades to black at the edges */
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    repeating-linear-gradient(30deg, rgba(255,255,255,.035) 0 1px, transparent 1px 56px),
    repeating-linear-gradient(150deg, rgba(255,255,255,.035) 0 1px, transparent 1px 56px);
  -webkit-mask-image: radial-gradient(circle at 50% 50%, #000 0%, transparent 62%);
          mask-image: radial-gradient(circle at 50% 50%, #000 0%, transparent 62%);
  opacity: 0;
  animation: fade 2.4s .9s ease forwards;
}
.stage {
  position: relative;
  width: min(56vmin, 360px);
  min-width: 150px;
  aspect-ratio: 212.24 / 237.59;
  cursor: pointer;
  border: 0;
  padding: 0;
  background: none;
}
.stage svg { width: 100%; height: 100%; display: block; overflow: visible; }
.stage .piece { fill: #fff; will-change: transform; }
.wordmark {
  position: fixed;
  left: 0; right: 0;
  bottom: max(28px, env(safe-area-inset-bottom));
  text-align: center;
  margin: 0;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: .3em;
  text-indent: .3em;
  text-transform: uppercase;
  color: var(--muted);
  opacity: 0;
  animation: fade 1.2s 1.6s ease forwards;
  pointer-events: none;
}
@keyframes fade { to { opacity: 1; } }

/* ---------- Document pages ---------- */
.page { min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; }
.top {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 32px 24px 0;
}
.mark { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--fg); }
.mark svg { width: 26px; height: auto; fill: #fff; }
.mark { transition: opacity .2s; }
.mark:hover { opacity: .7; }
.mark span { font-family: var(--mono); font-size: 12px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; }

main.doc {
  flex: 1;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 72px 24px 96px;
}
.eyebrow { margin: 0 0 14px; font-family: var(--mono); font-size: 12px; font-weight: 400; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
.doc h1 {
  margin: 0;
  color: var(--fg);
  font-size: clamp(38px, 8vw, 64px);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -.035em;
}
.meta { margin: 20px 0 0; color: var(--muted); font-family: var(--mono); font-size: 12.5px; letter-spacing: .02em; }
.lead { margin: 40px 0 0; font-size: 19px; line-height: 1.6; color: var(--text); }
.doc h2 {
  margin: 64px 0 0;
  padding-top: 28px;
  border-top: 1px solid var(--line);
  color: var(--fg);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -.01em;
  line-height: 1.3;
  scroll-margin-top: 24px;
}
.doc h3 { margin: 32px 0 0; color: var(--fg); font-size: 16px; font-weight: 500; }
.doc p, .doc ul { margin: 14px 0 0; }
.doc ul { padding-left: 1.2em; }
.doc li { margin: 6px 0; }
.doc li::marker { color: var(--muted); }
.doc ul.toc, .doc ul.topics { padding-left: 0; }
.doc strong { color: var(--fg); font-weight: 500; }
.toc { margin: 48px 0 0; padding: 0; list-style: none; columns: 2 220px; column-gap: 32px; font-size: 14px; }
.toc li { margin: 0 0 8px; break-inside: avoid; }
.toc a { text-decoration: none; color: var(--muted); }
.toc a:hover { color: var(--fg); }
.table-wrap { margin: 18px 0 0; overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 1.55; }
th, td { text-align: left; vertical-align: top; padding: 14px 16px; border-bottom: 1px solid var(--line); }
tr:last-child td { border-bottom: 0; }
th { color: var(--fg); font-family: var(--mono); font-weight: 400; font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; background: #070707; }
td:first-child { color: var(--fg); white-space: nowrap; }

/* Contact */
.contact-card {
  margin: 48px 0 0;
  padding: 32px;
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  background: linear-gradient(180deg, #0a0a0a, #000);
}
.contact-card .label { margin: 0; font-family: var(--mono); font-size: 12px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
.email {
  display: inline-block;
  margin: 12px 0 0;
  color: var(--fg);
  font-size: clamp(24px, 6vw, 40px);
  font-weight: 500;
  letter-spacing: -.02em;
  text-decoration: none;
  word-break: break-word;
}
.email:hover { text-decoration: underline; text-decoration-color: var(--line-strong); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 0; }
.btn {
  appearance: none;
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 46px;
  padding: 0 22px;
  border-radius: 999px;
  border: 1px solid var(--fg);
  font: 500 14px/1 var(--font);
  letter-spacing: .02em;
  text-decoration: none;
  cursor: pointer;
  transition: background .2s, color .2s, transform .2s;
}
.btn:active { transform: scale(.97); }
.btn-solid { background: var(--fg); color: #000; }
.btn-solid:hover { background: #d9d9d9; }
.btn-ghost { background: transparent; color: var(--fg); border-color: var(--line-strong); }
.btn-ghost:hover { border-color: var(--fg); }
.topics { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin: 18px 0 0; padding: 0; list-style: none; }
.topics li { margin: 0; padding: 20px; border: 1px solid var(--line); border-radius: 14px; }
.topics strong { display: block; margin-bottom: 4px; }
.topics span { color: var(--muted); font-size: 14px; line-height: 1.55; }

/* Contact form */
.contact-form { margin: 44px 0 0; display: grid; gap: 18px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field { display: grid; gap: 8px; min-width: 0; }
.field label { font-family: var(--mono); font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.field label span { text-transform: none; letter-spacing: 0; color: #555; margin-left: 6px; }
.field input, .field select, .field textarea {
  width: 100%;
  font: 400 16px/1.5 var(--font); /* 16px stops iOS zooming in on focus */
  color: var(--fg);
  background: #0a0a0a;
  border: 1px solid #262626;
  border-radius: 12px;
  padding: 13px 15px;
  outline: none;
  transition: border-color .2s, background .2s;
  -webkit-appearance: none; appearance: none;
}
.field textarea { min-height: 160px; resize: vertical; }
.field select { padding-right: 42px; cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23999' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 16px center; }
.field select option { background: #0a0a0a; color: #fff; }
.field input::placeholder, .field textarea::placeholder { color: #4d4d4d; }
.field input:hover, .field select:hover, .field textarea:hover { border-color: #3a3a3a; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: #fff; background: #0d0d0d; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin-top: 4px; }
.form-foot .btn { min-width: 170px; }
.btn:disabled { opacity: .55; cursor: default; transform: none; }
.form-status { margin: 0; font-size: 14px; line-height: 1.5; color: var(--muted); }
.form-status.ok { color: #fff; }
.form-status.err { color: #ff6b81; }
.form-note { margin: 0; font-size: 13px; color: #5e5e5e; }
.form-note a { color: var(--muted); }
@media (max-width: 560px) { .grid2 { grid-template-columns: 1fr; } .form-foot .btn { width: 100%; } }

/* Footer on document pages */
.foot {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 28px 24px max(32px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; gap: 10px 24px; justify-content: space-between;
  font-size: 13px; color: var(--muted);
}
.foot nav { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.foot a { color: var(--muted); text-decoration: none; }
.foot a:hover, .foot a[aria-current="page"] { color: var(--fg); }

/* 404 */
.lost { min-height: 100vh; min-height: 100svh; display: grid; place-items: center; text-align: center; padding: 24px; }
.lost h1 { margin: 24px 0 8px; color: var(--fg); font-size: 64px; font-weight: 700; letter-spacing: -.04em; line-height: 1; }
.lost p { margin: 0 0 28px; color: var(--muted); }
.lost svg { width: 64px; fill: #fff; }

@media (max-width: 480px) {
  body { font-size: 15.5px; }
  main.doc { padding-top: 56px; }
  .lead { font-size: 17px; }
  .contact-card { padding: 24px 20px; }
  th, td { padding: 12px; }
  td:first-child { white-space: normal; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition: none !important; }
}
