/* Augmatic — site styles. Paper and ink, with the mark's vermilion as the accent. */

@font-face {
  font-family: "Instrument Sans";
  src: url("fonts/instrument-sans.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("fonts/ibm-plex-mono-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light dark;

  --paper: #f7f5f0;
  --paper-2: #efece4;
  --surface: #ffffff;
  --text: #141518;
  --muted: #5c6068;
  --line: #e2ded4;
  --dot: #d6d1c4;

  --accent: #e4532b;          /* the mark's vermilion: fills, rules, large shapes */
  --accent-text: #b13d18;     /* the same hue, dark enough for small text */
  --accent-tint: #fbe4da;
  --accent-strong: #b13d18;   /* button hover */
  --on-accent-strong: #ffffff;

  --band: #141518;            /* the contact band and footer */
  --on-band: #f3f1ec;
  --muted-on-band: #a9acb3;
  --accent-on-band: #ff8b66;
  --line-on-band: rgba(255, 255, 255, 0.1);

  /* the mosaic's placeholder "pages" */
  --tint-1: #efe5d3;
  --tint-2: #dce7dc;
  --tint-3: #dbe4ef;
  --tint-4: #f1dfda;
  --skeleton: #e9e5dc;
  --skeleton-strong: #d9d4c9;
  --shadow: 0 1px 2px rgba(20, 21, 24, 0.04), 0 18px 40px -18px rgba(20, 21, 24, 0.18);
  --shadow-lift: 0 2px 4px rgba(20, 21, 24, 0.05), 0 30px 50px -20px rgba(20, 21, 24, 0.3);

  --font: "Instrument Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --max: 1160px;
  --gutter: clamp(16px, 4vw, 32px);
  --section: clamp(64px, 10vw, 128px);
  --radius: 14px;
  --header: 64px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #121315;
    --paper-2: #17191c;
    --surface: #1c1e22;
    --text: #eeece7;
    --muted: #a2a5ac;
    --line: #2b2e33;
    --dot: #2c2f34;

    --accent: #f0643c;
    --accent-text: #ff8b66;
    --accent-tint: #3b2018;
    --accent-strong: #ff8b66;
    --on-accent-strong: #121315;

    --band: #1c1e22;
    --on-band: #eeece7;
    --muted-on-band: #a2a5ac;
    --line-on-band: #2b2e33;

    --tint-1: #3a3327;
    --tint-2: #26332a;
    --tint-3: #243040;
    --tint-4: #3d2a27;
    --skeleton: #2a2d32;
    --skeleton-strong: #363a40;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 18px 40px -18px rgba(0, 0, 0, 0.7);
    --shadow-lift: 0 2px 4px rgba(0, 0, 0, 0.4), 0 30px 50px -20px rgba(0, 0, 0, 0.85);
  }
}

/* ---------- Base ---------- */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header) + 16px);
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font: 400 1.0625rem/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3 { margin: 0; font-weight: 600; line-height: 1.1; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
a { color: inherit; }
svg { display: block; }

h1 { font-size: clamp(2.5rem, 1.5rem + 4.4vw, 4.75rem); line-height: 1.02; letter-spacing: -0.035em; }
h2 { font-size: clamp(2rem, 1.4rem + 2.4vw, 3.25rem); line-height: 1.05; letter-spacing: -0.03em; }
h3 { font-size: 1.25rem; line-height: 1.25; letter-spacing: -0.015em; }

.wrap {
  width: 100%;
  max-width: calc(var(--max) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 var(--gutter);
}

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.skip {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 20;
  padding: 10px 16px;
  border-radius: 8px;
  background: var(--text);
  color: var(--paper);
  font-weight: 600;
  text-decoration: none;
}
.skip:focus { top: 12px; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  color: var(--accent-text);
  font: 500 0.75rem/1.4 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.eyebrow::before {
  content: "";
  width: 18px;
  height: 2px;
  background: currentColor;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: var(--header);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 1.1875rem;
  font-weight: 650;
  letter-spacing: -0.025em;
  text-decoration: none;
}

.mark { width: 28px; height: 28px; flex: none; }
.mark-tile { fill: var(--accent); }

.site-nav { display: flex; align-items: center; gap: 4px; }

.site-nav a {
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.15s, background-color 0.15s;
}
.site-nav a:hover { color: var(--text); background: var(--paper-2); }

.site-nav .nav-cta {
  margin-left: 6px;
  background: var(--surface);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--line);
}
.site-nav .nav-cta:hover { background: var(--surface); box-shadow: inset 0 0 0 1px var(--accent); }

@media (max-width: 640px) {
  .site-nav a:not(.nav-cta) { display: none; }
}

/* ---------- Buttons ---------- */

.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }

.button {
  display: inline-flex;
  align-items: center;
  height: 48px;
  padding: 0 24px;
  border-radius: 999px;
  background: var(--text);
  color: var(--paper);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.15s, color 0.15s, box-shadow 0.15s;
}
.button:hover { background: var(--accent-strong); color: var(--on-accent-strong); }

/* ---------- Hero ---------- */

.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: clamp(48px, 8vw, 104px) 0 clamp(64px, 9vw, 120px);
}

/* dotted ground behind the mosaic, fading out towards the copy */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: radial-gradient(var(--dot) 1.2px, transparent 1.6px);
  background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(ellipse 55% 70% at 78% 50%, #000 25%, transparent 75%);
  mask-image: radial-gradient(ellipse 55% 70% at 78% 50%, #000 25%, transparent 75%);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(40px, 6vw, 88px);
}

.lead {
  max-width: 34em;
  margin-top: 24px;
  color: var(--muted);
  font-size: clamp(1.125rem, 1rem + 0.45vw, 1.3125rem);
  line-height: 1.55;
}
.lead a { color: var(--accent-text); }

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); }
  .hero::before {
    -webkit-mask-image: radial-gradient(ellipse 80% 45% at 50% 78%, #000 25%, transparent 75%);
    mask-image: radial-gradient(ellipse 80% 45% at 50% 78%, #000 25%, transparent 75%);
  }
}

/* ---------- Mosaic: unnamed pages, each with its ad slot ---------- */

/* Each tile's offset is three lengths added together: the pointer parallax (--px/--py, set by site.js),
   the hover lift (--lift) and the slow drift (--fy, a keyframe animation). Registering them lets the
   lift transition and the drift animate; browsers without @property fall back to a still mosaic. */
@property --px { syntax: "<length>"; inherits: false; initial-value: 0px; }
@property --py { syntax: "<length>"; inherits: false; initial-value: 0px; }
@property --lift { syntax: "<length>"; inherits: false; initial-value: 0px; }
@property --fy { syntax: "<length>"; inherits: false; initial-value: 0px; }

.mosaic {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  grid-auto-rows: 38px;
  gap: 12px;
}

.tile {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  padding: 12px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transform: translate3d(var(--px, 0px), calc(var(--py, 0px) + var(--lift, 0px) + var(--fy, 0px)), 0);
  transition: --lift 0.5s cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 0.5s cubic-bezier(0.2, 0.7, 0.2, 1);
  animation: drift 9s ease-in-out infinite;
}
.tile-2 { animation-duration: 11s; animation-delay: -4s; }
.tile-3 { animation-duration: 8s; animation-delay: -2s; }
.tile-4 { animation-duration: 10s; animation-delay: -6s; }

@keyframes drift {
  50% { --fy: -6px; }
}

@media (hover: hover) and (pointer: fine) {
  .tile:hover { --lift: -6px; box-shadow: var(--shadow-lift); }
  /* hovering a page fills its ad slot */
  .tile .ad { transition: background-color 0.4s, border-color 0.4s; }
  .tile:hover .ad { background: var(--accent); border-color: var(--accent); }
  .tile:hover .ad::after { color: #fff; }
}

@media (prefers-reduced-motion: reduce) {
  .tile { animation: none; transition: none; }
}

.tile-1 { grid-column: 1 / span 4; grid-row: 1 / span 5; }
.tile-2 { grid-column: 5 / span 2; grid-row: 2 / span 5; padding-top: 8px; border-radius: 18px; }
.tile-3 { grid-column: 1 / span 2; grid-row: 6 / span 3; justify-content: center; gap: 10px; }
.tile-4 { grid-column: 3 / span 4; grid-row: 7 / span 4; }

.tile-bar { display: flex; align-items: center; gap: 5px; margin-bottom: 2px; }
.tile-bar i { width: 7px; height: 7px; border-radius: 50%; background: var(--skeleton-strong); }
.tile-bar b { flex: 1; height: 9px; margin-left: 8px; border-radius: 5px; background: var(--skeleton); }

.tile-notch { width: 34%; height: 5px; margin: 0 auto 4px; border-radius: 3px; background: var(--skeleton-strong); }

.tile-img { flex: 1; min-height: 24px; border-radius: 8px; }
.tint-1 { background: var(--tint-1); }
.tint-2 { background: var(--tint-2); }
.tint-3 { background: var(--tint-3); }
.tint-4 { background: var(--tint-4); }

.ln { display: block; height: 7px; border-radius: 4px; background: var(--skeleton); flex: none; }
.ln-h { height: 11px; background: var(--skeleton-strong); }
.w-50 { width: 50%; }
.w-60 { width: 60%; }
.w-70 { width: 70%; }
.w-80 { width: 80%; }
.w-90 { width: 90%; }

.ad {
  position: relative;
  flex: none;
  border: 1px dashed var(--accent);
  border-radius: 7px;
  background: var(--accent-tint);
}
.ad::after {
  content: "Ad";
  position: absolute;
  top: 3px;
  left: 6px;
  color: var(--accent-text);
  font: 500 9px/1 var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.ad-wide { height: 30px; }
.ad-box { height: 58px; }
.ad-tall { width: 34%; }

.row { display: flex; align-items: center; gap: 10px; }
.thumb { width: 26px; height: 26px; flex: none; border-radius: 7px; }
.row .ln { flex: 0 1 auto; }

.cols { display: flex; gap: 10px; flex: 1; min-height: 0; }
.col { display: flex; flex-direction: column; gap: 8px; flex: 1; min-width: 0; }

@media (max-width: 900px) {
  .mosaic { max-width: 560px; }
}
@media (max-width: 520px) {
  .mosaic { grid-auto-rows: 28px; gap: 10px; }
  .tile { padding: 10px; gap: 6px; }
  .tile-3 { gap: 8px; }
  .thumb { width: 20px; height: 20px; }
}

/* ---------- About ---------- */

.section { padding: var(--section) 0; border-top: 1px solid var(--line); }

.prose { max-width: 42rem; }
.prose h2 { margin-bottom: 28px; }
.prose p:not(.eyebrow) { font-size: 1.125rem; line-height: 1.65; }
.prose p + p { margin-top: 20px; }

/* ---------- Contact band and footer ---------- */

.contact {
  padding: var(--section) 0;
  background: var(--band);
  color: var(--on-band);
}
.contact h2 { max-width: 15em; }
.contact p { margin-top: 16px; color: var(--muted-on-band); font-size: 1.125rem; }

.contact-email {
  display: inline-block;
  margin-top: 32px;
  color: var(--on-band);
  font-size: clamp(1.5rem, 0.9rem + 3vw, 3rem);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.2;
  overflow-wrap: anywhere;
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 3px;
  text-underline-offset: 0.22em;
  transition: color 0.15s;
}
.contact-email:hover { color: var(--accent-on-band); }

.site-footer {
  padding: 28px 0 36px;
  background: var(--band);
  color: var(--muted-on-band);
  border-top: 1px solid var(--line-on-band);
  font-size: 0.875rem;
}
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 24px; }

/* ---------- 404 ---------- */

.notfound { min-height: calc(100vh - var(--header) - 100px); display: grid; align-content: center; }
.notfound::before { display: none; }
.notfound code {
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--paper-2);
  color: var(--text);
  font: 500 0.85em var(--mono);
  overflow-wrap: anywhere;
}
