/* Shared frame for project pages (/etchqr/, /registermitra/, ...).

   Every project page gets the same top bar, type, spacing, buttons and footer, so it
   always reads as part of spidey.in. What makes each page its own is set by the page:
   it overrides the colour and shape tokens below with the project's real ones and
   brings its own section layouts. No web or spider motifs here; those belong to the
   homepage. */

:root {
  /* defaults are the homepage's tokens; a project page overrides what differs */
  --bg: #0d0e12; --bg-2: #121419; --panel: #171a20; --panel-2: #1d2129;
  --line: #252932; --line-2: #343945;
  --fg: #eceef2; --fg-2: #a6abb6; --fg-3: #868c98;
  --accent: #3563f5; --accent-hover: #2a55e6; --accent-ink: #fff; /* text on an accent fill */
  --accent-text: #7aa2ff; --accent-soft: rgba(53,99,245,.14); --accent-line: rgba(122,162,255,.45);
  --r-card: 12px; --r-tile: 8px; --r-ctl: 8px; --r-chip: 6px;
  --display: 'Bricolage Grotesque', ui-sans-serif, system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, monospace;
  --brand-font: 'Bricolage Grotesque', ui-sans-serif, system-ui, sans-serif; /* the spidey. mark never changes */
  --ease: cubic-bezier(.16,1,.3,1);
}

* { box-sizing: border-box; margin: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; color-scheme: dark; }
body { background: var(--bg); color: var(--fg); font: 16px/1.6 var(--display); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; height: auto; -webkit-user-drag: none; }
button, input { font: inherit; color: inherit; }
::selection { background: var(--accent-soft); color: var(--fg); }
:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 3px; border-radius: 6px; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 28px; }
.skip { position: absolute; left: 16px; top: -48px; z-index: 30; background: var(--accent); color: var(--accent-ink); padding: 8px 14px; border-radius: var(--r-ctl); }
.skip:focus { top: 12px; }
i { font-style: normal; display: inline-flex; flex: none; }
i > svg { width: 1em; height: 1em; fill: currentColor; }

/* ---------- Top bar: spidey. / Project ---------- */
.top { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 84%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.top .wrap { height: 60px; display: flex; align-items: center; gap: 12px; }
.brand { font: 800 20px var(--brand-font); letter-spacing: -.035em; }
.brand span { color: var(--fg-3); transition: color .2s; }
.brand:hover span { color: var(--fg); }
.crumb { display: flex; align-items: center; gap: 10px; color: var(--fg-3); font-size: 15px; min-width: 0; }
.crumb b { display: flex; align-items: center; gap: 8px; color: var(--fg); font-weight: 600; white-space: nowrap; }
.crumb b svg, .crumb b img { width: 18px; height: 18px; flex: none; }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.back { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; border-radius: var(--r-ctl); color: var(--fg-2); font-size: 14.5px; font-weight: 500; white-space: nowrap; transition: color .15s, background .15s; }
.back:hover { color: var(--fg); background: var(--panel); }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 0 16px; border-radius: var(--r-ctl); font: 600 14.5px var(--display); border: 1px solid var(--line-2); background: var(--bg-2); color: var(--fg); white-space: nowrap; cursor: pointer; transition: background .2s, border-color .2s, transform .1s; }
.btn:hover { background: var(--panel); border-color: var(--fg-3); }
.btn:active { transform: scale(.98); }
.btn-lg { height: 48px; padding: 0 24px; font-size: 16px; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn i { font-size: 17px; }
.btn[aria-disabled="true"] { opacity: .5; pointer-events: none; }
.tlink { color: var(--fg-2); font-weight: 500; text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 5px; transition: color .15s, text-decoration-color .15s; }
.tlink:hover { color: var(--fg); text-decoration-color: var(--accent-text); }

/* ---------- Type and section rhythm ---------- */
.section { padding-top: 112px; }
h1, h2, h3 { text-wrap: balance; }
h1 { font-size: clamp(40px, 5vw, 64px); line-height: 1.02; letter-spacing: -.045em; font-weight: 800; }
h2 { font-size: clamp(30px, 3.4vw, 44px); line-height: 1.05; letter-spacing: -.04em; font-weight: 800; }
h3 { font-size: 19px; line-height: 1.3; letter-spacing: -.015em; font-weight: 700; }
p { text-wrap: pretty; }
.lede { font-size: 18px; color: var(--fg-2); max-width: 56ch; margin-top: 16px; }
.body { color: var(--fg-2); max-width: 62ch; }
.surface { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-card); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; }
.chip { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 13px; border-radius: var(--r-chip); border: 1px solid var(--line-2); background: var(--bg); font-size: 14.5px; color: var(--fg-2); white-space: nowrap; }
.chip i { color: var(--accent-text); font-size: 16px; }

/* ---------- More projects + footer ---------- */
.more { padding: 112px 0 0; }
.more-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.more-head h2 { font-size: 24px; letter-spacing: -.03em; }
.more-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.more-card { display: grid; grid-template-columns: 44px 1fr 18px; gap: 14px; align-items: center; padding: 16px 18px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-card); transition: border-color .2s, background .2s; }
.more-card:hover { border-color: var(--line-2); background: var(--panel); }
.more-card .ic { width: 44px; height: 44px; border-radius: var(--r-tile); background: var(--panel-2); display: grid; place-items: center; font-size: 20px; color: var(--fg-2); overflow: hidden; }
.more-card .ic img { width: 100%; height: 100%; object-fit: cover; }
.more-card .ic.round { position: relative; overflow: visible; border-radius: 50%; }
.more-card .ic.round > img:not(.pip) { border-radius: 50%; }
.more-card .ic .pip { position: absolute; right: -6px; bottom: -6px; width: 21px; height: 21px; border-radius: 50%; border: 2px solid var(--bg-2); box-sizing: border-box; }
.more-card:hover .ic .pip { border-color: var(--panel); }
.more-card b { display: block; font-weight: 700; font-size: 17px; letter-spacing: -.015em; }
.more-card small { display: block; font-size: 14px; color: var(--fg-3); line-height: 1.4; }
.more-card > i { color: var(--fg-3); transition: transform .3s var(--ease), color .2s; }
.more-card:hover > i { color: var(--accent-text); transform: translateX(3px); }
footer { margin-top: 96px; border-top: 1px solid var(--line); }
.foot { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding: 24px 0 36px; font: 13px var(--mono); color: var(--fg-3); }
.foot a:hover { color: var(--fg); }
.foot .brand { font-size: 18px; color: var(--fg); }

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: no-preference) {
  .rv { opacity: 0; transform: translateY(14px); transition: opacity .7s var(--ease), transform .7s var(--ease); transition-delay: calc(var(--i, 0) * 70ms); }
  .rv.in { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  .wrap { padding: 0 16px; }
  .section, .more { padding-top: 72px; }
  .back span, .crumb > span { display: none; }
  .back { padding: 0 8px; }
  .lede { font-size: 17px; }
  .more-grid { grid-template-columns: 1fr; }
  footer { margin-top: 64px; }
}
