/* Homepage: stacking columns + black-and-white masonry. Square corners throughout. */
@font-face { font-family: "Archivo"; src: url("/fonts/archivo.woff2") format("woff2-variations"), url("/fonts/archivo.woff2") format("woff2"); font-weight: 100 900; font-stretch: 62% 125%; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("/fonts/geist-mono.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

/* Black and white. Photos go greyscale; one orange accent. */
:root {
  --bg: #0a0a0a; --panel: #121212; --ink: #ebebe7; --muted: #85857f; --line: #262626;
  --accent: #ff4f00;
}
:root {
  --font: "Archivo", ui-sans-serif, system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, Menlo, monospace;
  --side: 300px; --panel-w: 420px; --gap: 6px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; border-radius: 0; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.5 var(--font); -webkit-font-smoothing: antialiased; transition: background 0.4s; }
p, ol, ul, h2 { margin: 0; padding: 0; list-style: none; }
a { color: inherit; }
img, video { display: block; width: 100%; height: auto; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- columns ---------- */
.shell {
  display: grid; grid-template-columns: var(--side) 0 minmax(0, 1fr);
  min-height: 100dvh; transition: grid-template-columns 0.5s var(--ease);
}
.shell.stacked { grid-template-columns: var(--side) var(--panel-w) minmax(0, 1fr); }
.col { min-width: 0; }
.side { grid-column: 1; } .panel { grid-column: 2; } .grid { grid-column: 3; grid-row: 1; }
.side, .panel {
  position: sticky; top: 0; height: 100dvh; overflow-y: auto;
  padding: 36px 32px; border-right: 1px solid var(--line); background: var(--panel);
}
.side { display: flex; flex-direction: column; justify-content: space-between; gap: 40px; }

.me-h { margin: 0; font-size: inherit; }
.me {
  display: flex; flex-direction: column; text-decoration: none;
  font-weight: 800; font-stretch: 62%; font-size: 64px; line-height: 0.86; letter-spacing: -0.01em; text-transform: uppercase;
}
.me span:last-child { color: var(--accent); }
.side-links { margin-top: 40px; display: grid; gap: 4px; }
.side-links a, .socials a { text-decoration: none; }
.side-links a { font-size: 21px; font-weight: 500; }
.side-links a:hover, .side-links a.on, .socials a:hover { color: var(--accent); }
.socials { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 16px; }
.meta, .kick, .story span, .list span, .close {
  font: 500 11.5px/1.4 var(--mono); text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted);
}
.meta { margin-top: 16px; display: flex; justify-content: space-between; gap: 12px; }
.meta a { text-decoration: none; }
.meta a:hover { color: var(--accent); }

/* ---------- the stacked panel ---------- */
.panel { animation: slide 0.5s var(--ease); }
@keyframes slide { from { opacity: 0; transform: translateX(-16px); } }
.panel[hidden] { display: none; }
.close { display: block; margin: -4px 0 28px auto; }
.close:hover { color: var(--accent); }
.panel h2 { font-weight: 800; font-stretch: 62%; font-size: 44px; line-height: 0.95; text-transform: uppercase; }
.panel .kick { margin-top: 10px; color: var(--accent); }
.panel article > p:not(.kick):not(.links) { margin-top: 18px; font-size: 17px; line-height: 1.55; }
.links { margin-top: 24px; display: flex; flex-wrap: wrap; gap: 8px 20px; }
.links a, .list a { text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 4px; text-decoration-thickness: 1.5px; }
.links a:hover, .list a:hover { color: var(--accent); }
.story, .list { margin-top: 24px; }
.story li, .list li { padding-block: 14px; border-top: 1px solid var(--line); }
.story span, .list span { display: block; color: var(--accent); }
.story p { margin-top: 4px; font-size: 15.5px; line-height: 1.5; }
.sub-project { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); }
.sub-project h3 { margin: 0; font-weight: 800; font-stretch: 62%; font-size: 30px; line-height: 1; text-transform: uppercase; }
.sub-project > p:not(.kick):not(.links) { margin-top: 14px; font-size: 16.5px; line-height: 1.55; }
.list li { display: flex; flex-direction: column-reverse; gap: 4px; font-size: 17px; line-height: 1.35; }

/* ---------- black-and-white masonry ---------- */
.grid { columns: 3 240px; column-gap: var(--gap); padding: var(--gap); }
.stacked .grid { columns: 2 220px; }
.pin {
  position: relative; display: block; margin-bottom: var(--gap); break-inside: avoid;
  overflow: hidden; background: var(--panel); color: #fff; text-decoration: none; isolation: isolate;
}
/* Photos sit in black and white; hover shows the real colors. */
.pin img, .pin video, .meteor { filter: grayscale(1) contrast(1.15) brightness(0.9); transition: filter 0.5s, transform 0.8s var(--ease); }
.pin:hover img, .pin:hover video, .pin:focus-visible img, .pin:focus-visible video, .pin.on img, .pin.on video { filter: none; transform: scale(1.02); }
.pin:hover .meteor, .pin:focus-visible .meteor, .pin.on .meteor { filter: none; }
.pin.on { outline: 2px solid var(--accent); outline-offset: -2px; }

.cap {
  position: absolute; inset: auto 0 0 0; z-index: 2; display: block; padding: 56px 16px 14px;
  background: linear-gradient(to top, rgb(0 0 0 / 0.9), rgb(0 0 0 / 0.72) 50%, transparent);
}
.cap .kick { display: block; color: var(--accent); }
.cap strong { display: block; margin-top: 2px; font-weight: 800; font-stretch: 70%; font-size: 26px; line-height: 1; text-transform: uppercase; }
.cap .sub { display: block; margin-top: 6px; font-size: 14px; line-height: 1.4; color: rgb(255 255 255 / 0.82); }
@media (hover: hover) and (pointer: fine) {
  .cap { opacity: 0; transform: translateY(8px); transition: opacity 0.3s, transform 0.5s var(--ease); }
  .pin:hover .cap, .pin:focus-visible .cap, .pin.on .cap { opacity: 1; transform: none; }
}

/* Marketing Meteor: the drifting blue glow from its homepage hero. */
.meteor { position: relative; display: grid; place-items: center; aspect-ratio: 4 / 3; background: #000; overflow: hidden; }
.meteor::before, .meteor::after { content: ""; position: absolute; inset: -50%; will-change: transform; }
/* Two glows sweep past each other so the motion reads even in greyscale. */
.meteor::before {
  background:
    radial-gradient(32% 28% at 68% 30%, rgb(90 130 255 / 0.95), rgb(40 80 255 / 0.5) 45%, transparent 72%),
    radial-gradient(26% 30% at 22% 72%, rgb(60 100 255 / 0.8), transparent 70%);
  animation: drift 6s ease-in-out infinite alternate;
}
.meteor::after {
  background: radial-gradient(22% 22% at 40% 45%, rgb(150 180 255 / 0.55), transparent 70%);
  animation: drift-back 7.5s ease-in-out infinite alternate;
}
@keyframes drift { from { transform: translate(-14%, -8%) rotate(-6deg); } to { transform: translate(16%, 12%) rotate(10deg); } }
@keyframes drift-back { from { transform: translate(18%, 10%); } to { transform: translate(-16%, -12%); } }
.meteor-word { position: relative; z-index: 1; font-size: 34px; font-weight: 300; letter-spacing: -0.02em; color: #fff; }

/* ---------- desktop: the grid fills exactly one screen ---------- */
/* A fixed 4 x 3 layout sized to the window, so every tile shows without
   scrolling. Photos crop to their cells. Phones keep the scrolling columns. */
@media (min-width: 901px) {
  .grid {
    columns: auto; height: 100dvh; position: sticky; top: 0;
    display: grid; gap: var(--gap);
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-template-rows: repeat(3, minmax(0, 1fr));
    grid-template-areas:
      "hermie hack  meteor reading"
      "hermie hack  bmw    writing"
      "story  sound bmw    photos";
  }
  .grid .pin { margin: 0; min-height: 0; }
  .grid .pin img, .grid .pin video { width: 100%; height: 100%; object-fit: cover; }
  .grid .meteor { aspect-ratio: auto; height: 100%; }
  [data-area="hermie"] { grid-area: hermie; } [data-area="bmw"] { grid-area: bmw; }
  [data-area="meteor"] { grid-area: meteor; } [data-area="story"] { grid-area: story; }
  [data-area="hack"] { grid-area: hack; } [data-area="writing"] { grid-area: writing; }
  [data-area="reading"] { grid-area: reading; } [data-area="sound"] { grid-area: sound; }
  [data-area="photos"] { grid-area: photos; }
  .cap { padding: 40px 14px 12px; }
  .cap strong { font-size: clamp(18px, 1.6vw, 24px); }
  .cap .sub { font-size: 13px; }
  .meteor-word { font-size: clamp(22px, 2.2vw, 32px); }

  /* With a panel open the grid is too narrow to fit one screen, so it goes
     back to scrolling columns with each tile at its natural shape. */
  .stacked .grid { display: block; height: auto; position: static; columns: 2 220px; column-gap: var(--gap); }
  .stacked .grid .pin { margin-bottom: var(--gap); }
  .stacked .grid .pin img, .stacked .grid .pin video { height: auto; object-fit: fill; }
  .stacked .grid .meteor { aspect-ratio: 4 / 3; height: auto; }
}

/* ---------- small screens: one column, panel becomes a sheet ---------- */
@media (max-width: 900px) {
  .shell, .shell.stacked { display: block; }
  .side { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); gap: 28px; }
  .me { font-size: 56px; }
  .grid, .stacked .grid { columns: 2 150px; }
  .panel { position: fixed; inset: 0; z-index: 20; height: auto; border: 0; }
  .cap { padding: 40px 10px 10px; }
  .cap strong { font-size: 19px; }
  .cap .sub { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .shell, .panel, .pin img, .pin video, .cap, .meteor::before, .meteor::after { transition: none !important; animation: none !important; }
}
