:root {
  --bg: #0a0a0b;
  --fg: #f4f2ec;
  --fg-2: #c9c7c0;
  --fg-3: #b5b3ac;
  --tile: #17181d;
  --line: #3a3b40;
  --radius: 26px;
  --gap: 12px;
  --display: "Bricolage Grotesque", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.45 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
}
img, video, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
a:focus-visible { outline: 2px solid #8fa3ff; outline-offset: 3px; border-radius: 6px; }
h1, h2, p, ul { margin: 0; padding: 0; }
ul { list-style: none; }

.page {
  max-width: 1220px;
  margin: 0 auto;
  padding: 56px 20px 72px;
  display: flex;
  flex-direction: column;
  gap: 56px;
}
main { display: flex; flex-direction: column; gap: 56px; }

/* ── Header ─────────────────────────────────────────── */
.top { display: flex; flex-direction: column; gap: 24px; }
.bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.mark { font-family: var(--display); font-weight: 800; font-size: 18px; letter-spacing: -0.02em; }
nav { display: flex; gap: 24px; font-size: 15px; }
nav a { padding: 12px 0; }
nav a:hover, .fine a:hover { color: #fff; text-decoration: underline; text-underline-offset: 4px; }
h1 {
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-weight: 700;
  font-size: clamp(56px, 11.6vw, 152px);
  line-height: 0.9;
  letter-spacing: -0.055em;
}
.lede { max-width: 640px; font-size: clamp(19px, 1.9vw, 24px); line-height: 1.4; color: var(--fg-2); }

/* ── Sections ───────────────────────────────────────── */
section { display: flex; flex-direction: column; gap: 18px; scroll-margin-top: 24px; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; }
h2 { font-family: var(--display); font-weight: 800; font-size: 30px; letter-spacing: -0.03em; }
.swipe-hint { display: none; font-size: 14px; color: var(--fg-3); }

.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--gap); }

/* ── Tiles ──────────────────────────────────────────── */
.tile {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--tile);
  color: #fff;
  display: flex;
  min-width: 0;
  transition: transform 0.18s ease;
}
a.tile:hover { transform: translateY(-5px) rotate(-0.6deg); }
.tile-text { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 28px; min-width: 0; flex: 1; }
.title { font-family: var(--display); font-weight: 800; font-size: clamp(28px, 2.8vw, 38px); line-height: 0.95; letter-spacing: -0.03em; }
.title.big { font-size: clamp(30px, 3.2vw, 44px); }
.title.sm { font-size: 24px; line-height: 1; }
.line { font-size: 17px; }
.line.sm { font-size: 15px; }
.status { margin-top: auto; padding-top: 16px; font-size: 14px; font-weight: 600; }
.status.muted { font-weight: 400; color: var(--fg-2); }
.icon { width: 56px; height: 56px; border-radius: 14px; margin-bottom: 8px; flex: none; }
.icon.moon { background: #0f1115; display: flex; align-items: center; justify-content: center; }
.icon.moon svg { width: 34px; height: 34px; }
.cover { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* Apps */
.tm { grid-column: span 12; min-height: 400px; background: #3d1611; flex-wrap: wrap; }
.tm .tile-text { flex: 1 1 280px; max-width: 420px; }
.tm-photo { position: relative; flex: 3 1 420px; min-height: 300px; }
.tm-photo .cover { object-position: center 45%; }
.tm-phone {
  position: absolute; left: 28px; bottom: -90px; width: 190px; height: auto;
  border-radius: 22px; border: 5px solid var(--bg);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55); transform: rotate(-4deg);
}

.ca { grid-column: span 8; min-height: 360px; background: #1b2559; flex-wrap: wrap; }
.ca .tile-text { flex: 1 1 200px; padding-right: 0; }
.ca .line.sm { color: #d5dbfb; max-width: 34ch; }
.ca-card {
  flex: 1 1 260px; max-width: 320px; align-self: flex-end; margin: 28px 28px 0;
  background: #171a21; border: 1px solid #2e3440; border-bottom: 0;
  border-radius: 18px 18px 0 0; overflow: hidden; box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.35);
}
.ca-card img { width: 100%; height: auto; }

.cv { grid-column: span 4; min-height: 360px; background: #0e3550; }
.cv .tile-text { padding-right: 0; }
.cv-phone {
  flex: none; align-self: center; width: 150px; margin: 24px 28px 24px 16px;
  border-radius: 22px; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5); transform: rotate(3deg);
}

/* Builds */
.ink { grid-column: span 8; min-height: 320px; background: #efe6d6; color: var(--bg); flex-wrap: wrap; }
.ink .tile-text { flex: 1 1 200px; padding-right: 0; }
.ink-wrap { flex: 1 1 260px; max-width: 360px; align-self: center; margin: 28px; }
.ink-frame {
  position: relative; display: block; aspect-ratio: 900 / 635;
  box-shadow: 0 18px 36px rgba(60, 40, 20, 0.35), 0 2px 4px rgba(60, 40, 20, 0.3);
}
.ink-frame img { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; }
.ink-frame img:first-child, .ink-frame img.on { opacity: 1; }
/* The sky time-lapse sits exactly over the screen inside the wood frame. */
.ink-frame video {
  position: absolute; left: 13.33%; top: 18.77%; width: 73.22%; height: 62.3%;
  object-fit: fill; opacity: 0;
}
.ink-frame video.on { opacity: 1; }

.epic { grid-column: span 4; min-height: 320px; background: #3a1446; flex-direction: column; }
.epic .tile-text { flex: none; padding-bottom: 0; }
.led {
  margin: auto 20px 20px; background: var(--bg); border-radius: 10px; padding: 12px;
  display: grid; grid-template-columns: repeat(32, minmax(0, 1fr)); gap: 2px;
}
.led i { aspect-ratio: 1; border-radius: 50%; background: #34353a; }
.led i.p { background: #ff2d9a; }
.led i.c { background: #19c8ff; }

.small { grid-column: span 3; min-height: 230px; flex-direction: column; }
.small .tile-text { padding: 22px; gap: 4px; }
.small .status { padding-top: 8px; }
.cadence { background: #12402b; }
.cadence .tile-text { flex: none; padding-bottom: 0; }
.cadence .status { margin-top: 0; padding-top: 2px; }
.chart { margin: auto 14px 14px; background: var(--bg); border-radius: 14px; padding: 10px 12px; }
.chart svg { width: 100%; height: 70px; }
.futuro { background: #4a2209; }
.futuro .tile-text { flex: none; padding-bottom: 0; }
.stickers {
  margin: auto 22px 22px auto; background: var(--bg); border-radius: 14px; padding: 8px;
  display: grid; grid-template-columns: repeat(3, 22px); gap: 5px;
}
.stickers i { height: 22px; border-radius: 5px; }
.wear { background: #3d3208; }
.onion { background: #2b1b3f; }

/* Videos and photos */
.redkb { grid-column: span 5; min-height: 300px; background: #4b0c0e; }
.redkb .tile-text { padding-right: 0; }
.redkb-icon {
  flex: none; width: 36%; max-width: 190px; height: auto; align-self: center; margin: 24px;
  border-radius: 26px; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
}
.darksky { grid-column: span 4; min-height: 300px; background: #0b1020; }
.darksky .cover { object-position: 38% center; }
.scrim { position: absolute; inset: 0; background: rgba(6, 9, 22, 0.5); }
.kicker { font-size: 14px; font-weight: 600; color: #ffb4ae; }
.darksky .kicker { color: #c9d4ff; }
.stat { margin-top: auto; padding-top: 16px; display: flex; align-items: baseline; gap: 8px; font-size: 15px; color: #ffd9d5; }
.stat b { font-family: var(--display); font-weight: 800; font-size: 52px; line-height: 1; letter-spacing: -0.04em; color: #fff; }
.substat { font-size: 15px; color: #ffd9d5; }
.darksky .stat, .darksky .substat { color: #e3e8ff; }

.photos { grid-column: span 3; min-height: 300px; flex-direction: column; padding: 28px 24px 20px; }
.photos ul { margin-top: auto; }
.photos li + li { border-top: 1px solid var(--line); }
.photos li a { display: flex; justify-content: space-between; gap: 12px; padding: 13px 0; }
.photos li a span { color: var(--fg-2); }
.photos li a:hover b { text-decoration: underline; text-underline-offset: 4px; }

/* Day job + footer */
.dayjob {
  flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 8px 32px;
  border-radius: var(--radius); background: var(--tile); padding: 28px;
}
.dayjob h2 { font-size: clamp(28px, 2.8vw, 38px); line-height: 0.95; }
.dayjob p { color: var(--fg-2); font-size: 17px; }
.linkedin { margin-left: auto; padding: 12px 0; font-weight: 600; text-decoration: underline; text-underline-offset: 4px; }
.linkedin:hover { color: #fff; }

.foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 16px; }
.hi { font-family: var(--display); font-weight: 800; font-size: clamp(28px, 4vw, 52px); letter-spacing: -0.035em; line-height: 1; padding: 8px 0; }
.hi:hover { text-decoration: underline; text-underline-offset: 8px; text-decoration-thickness: 3px; }
.fine { display: flex; gap: 24px; font-size: 14px; color: var(--fg-3); }

/* ── Tablet ─────────────────────────────────────────── */
@media (max-width: 1000px) {
  .ca, .ink, .redkb { grid-column: span 12; }
  .cv, .epic { grid-column: span 12; }
  .small { grid-column: span 6; }
  .darksky { grid-column: span 7; }
  .photos { grid-column: span 5; }
  .cv-phone { margin-right: 48px; }
}

/* ── Phone: swipe rows ──────────────────────────────── */
@media (max-width: 700px) {
  :root { --radius: 24px; --gap: 10px; }
  .page { padding: 20px 16px 40px; gap: 36px; overflow-x: hidden; }
  main { gap: 36px; }
  .top { gap: 18px; }
  nav { gap: 20px; }
  .nav-email { display: none; }
  h1 { font-size: clamp(60px, 20vw, 92px); line-height: 0.88; }
  .lede { font-size: 19px; }
  section { gap: 14px; }
  h2 { font-size: 26px; }
  .swipe-hint { display: inline; }
  a.tile:hover { transform: none; }

  .row {
    display: flex; overflow-x: auto; scroll-snap-type: x mandatory;
    margin: 0 -16px; padding: 0 16px; scroll-padding-left: 16px;
    scrollbar-width: none; -webkit-overflow-scrolling: touch;
  }
  .row::-webkit-scrollbar { display: none; }
  .row > .tile { flex: none; scroll-snap-align: start; flex-direction: column; flex-wrap: nowrap; }

  .tile-text { padding: 22px; gap: 6px; }
  .title, .title.big { font-size: 30px; }
  .line { font-size: 16px; }
  .icon { width: 40px; height: 40px; border-radius: 10px; margin-bottom: 4px; }
  .icon.moon svg { width: 26px; height: 26px; }
  .status { margin-top: 0; padding-top: 2px; }

  /* Apps: three tall cards */
  #apps .row > .tile { width: 81vw; max-width: 340px; height: 500px; min-height: 0; }
  #apps .tile-text { flex: none; max-width: none; padding-bottom: 16px; }
  .tm-photo { flex: 1; min-height: 0; width: 100%; }
  .tm-phone { left: 16px; bottom: -120px; width: 130px; border-width: 4px; border-radius: 16px; }
  .ca-card { flex: none; max-width: none; align-self: stretch; margin: auto 20px 0; border-radius: 16px 16px 0 0; }
  .cv-phone { width: 122px; margin: auto; border-radius: 18px; }
  .cv .tile-text { padding-right: 22px; padding-bottom: 0; }

  /* Builds: six square-ish cards */
  #builds .row > .tile { width: 67vw; max-width: 280px; height: 290px; min-height: 0; }
  #builds .tile-text { flex: none; padding: 20px 20px 0; gap: 4px; }
  #builds .title { font-size: 24px; line-height: 1; }
  #builds .line { font-size: 15px; }
  .ink .status { display: none; }
  .ink-wrap { flex: none; max-width: none; align-self: stretch; margin: auto 20px 20px; }
  .led { margin: auto 16px 16px; padding: 10px; gap: 1.5px; border-radius: 8px; }
  .chart svg { height: 90px; }
  .stickers { margin: auto 20px 20px auto; padding: 10px; grid-template-columns: repeat(3, 30px); gap: 6px; border-radius: 16px; }
  .stickers i { height: 30px; border-radius: 7px; }
  .wear .tile-text, .onion .tile-text { flex: 1; padding-bottom: 20px; }
  .wear .status, .onion .status { margin-top: auto; }

  /* Videos: two up, then photo links in a row */
  .videos { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .redkb, .darksky { grid-column: span 1; min-height: 250px; height: 250px; }
  .redkb { flex-direction: column-reverse; justify-content: flex-end; }
  .redkb-icon { width: 64px; margin: 18px 18px 0; border-radius: 16px; align-self: flex-start; box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45); }
  .videos .tile-text { padding: 18px; gap: 4px; }
  .redkb .tile-text { padding-top: 14px; }
  .videos .kicker { display: none; }
  .videos .title { font-size: 26px; }
  .videos .line { font-size: 14px; }
  .stat { font-size: 13px; gap: 6px; }
  .stat b { font-size: 40px; }
  .substat { font-size: 13px; }
  .since { display: none; }
  .photos { grid-column: span 2; min-height: 0; padding: 0; background: none; border-radius: 0; overflow: visible; }
  .photos .title { display: none; }
  .photos ul { display: flex; gap: 10px; margin: 0; }
  .photos li { flex: 1; }
  .photos li + li { border: 0; }
  .photos li a { flex-direction: column; gap: 0; justify-content: center; min-height: 56px; padding: 10px 14px; border-radius: 16px; background: var(--tile); font-size: 15px; }
  .photos li a span { font-size: 13px; }

  .dayjob { padding: 22px; flex-direction: column; gap: 6px; }
  .dayjob h2 { font-size: 26px; }
  .dayjob p { font-size: 15px; }
  .linkedin { margin-left: 0; padding-bottom: 0; }
  .foot { flex-direction: column; gap: 14px; }
  .hi { font-size: 40px; line-height: 0.95; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .tile { transition: none; }
  a.tile:hover { transform: none; }
}
