/* Major Mono Display — main typeface */
@font-face { font-family: "Major Mono Display"; src: url(fonts/major-mono-display-latin.woff2) format("woff2"); font-weight: 400; font-display: swap;
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Major Mono Display"; src: url(fonts/major-mono-display-latin-ext.woff2) format("woff2"); font-weight: 400; font-display: swap;
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
/* Cormorant Garamond italic — write-ups */
@font-face { font-family: "Cormorant Garamond"; src: url(fonts/cormorant-garamond-latin-italic.woff2) format("woff2-variations"); font-weight: 300 700; font-style: italic; font-display: swap;
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Cormorant Garamond"; src: url(fonts/cormorant-garamond-latin-ext-italic.woff2) format("woff2-variations"); font-weight: 300 700; font-style: italic; font-display: swap;
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
/* Geist Mono — only for the arrows + dots Major Mono doesn't have */
@font-face { font-family: "Geist Mono"; src: url(fonts/GeistMono-Variable.woff2) format("woff2-variations"); font-weight: 100 900; font-display: swap;
  unicode-range: U+2190-21FF, U+25A0-25FF; }

:root {
  --bg: #ffffff;
  --ink: #141414;
  --mute: #8a8a8a;
  --rule: #dedede;
  --blue: #2435ff;
  --green: #12a84a;
  --red: #e5322d;
  --side: 33.333vw;
  --gut: clamp(14px, 1.6vw, 24px);
  --fs: 12.5px;              /* one type size for the whole site (Major Mono is wide + all-caps height) */
  --fs-body: 19px;           /* write-ups in Cormorant italic (it runs much smaller than Major Mono) */
  --body: "Cormorant Garamond", Garamond, "Times New Roman", serif;
  --ease: cubic-bezier(.65, 0, .25, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-anchor: none; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 var(--fs)/1.6 "Major Mono Display", "Geist Mono", ui-monospace, Menlo, monospace;
  /* Major Mono: lowercase letters draw as thin caps, real capitals draw as heavy oddballs. Keep normal casing. */
  font-variant-numeric: lining-nums;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .2em; }
a:hover { text-decoration: none; }
a.ext { color: var(--green); }
button { font: inherit; text-transform: inherit; letter-spacing: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-align: left; }
p, h3, ul, ol, figure { margin: 0; padding: 0; }
h3, small { font-size: inherit; font-weight: inherit; }
strong, b { font-weight: inherit; }
html.tw-pending body { opacity: 0; }
.tw-cur { background: var(--blue); color: #fff !important; }
/* intro: each scrambling letter keeps its real width (proportional font), a random glyph sits on top */
.sc { position: relative; -webkit-text-fill-color: transparent; }
.sc::after { content: attr(data-c); position: absolute; left: 50%; top: 0; line-height: normal; transform: translateX(-50%); -webkit-text-fill-color: currentColor; }
ul, ol { list-style: none; }
i { font-style: normal; }
::selection { background: var(--blue); color: #fff; }

.layout { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); }

/* ── left panel ── */
.side {
  position: sticky; top: 0; height: 100vh; height: 100svh;
  display: flex; flex-direction: column;
  padding: var(--gut); border-right: 1px solid var(--rule);
}
.side-top { display: flex; flex-direction: column; }
.who-name { margin-bottom: 14px; }
.who-name a { color: var(--ink); text-decoration: none; }
.intro { max-width: 48ch; margin-bottom: 22px; }
.more { color: var(--blue); white-space: nowrap; }
@media (hover: hover) { .more:hover { text-decoration: underline; text-underline-offset: .2em; } }
.more-b { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .45s var(--ease); }
.intro.open .more-b { grid-template-rows: 1fr; }
.more-in { overflow: hidden; min-height: 0; }
.more-in p { margin-top: .9em; }

/* accordion */
.acc {
  flex: 0 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  border-top: 1px solid var(--ink); scrollbar-width: thin;
}
.acc-item { border-bottom: 1px solid var(--rule); }
.acc-h { width: 100%; display: flex; justify-content: space-between; align-items: baseline; padding: 7px 0 6px; }
.acc-h:hover, .acc-item.open .acc-h { color: var(--blue); }

.acc-b { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .45s var(--ease); }
.acc-item.open .acc-b { grid-template-rows: 1fr; }
.acc-in { overflow: hidden; min-height: 0; }
.acc-item.open .acc-in { padding-bottom: 12px; }
.about p + p { margin-top: .8em; }
.list li { display: grid; gap: 1.5ch; padding: 6px 0; }
.list li + li { border-top: 1px dotted var(--rule); }
.xp li { grid-template-columns: 10ch minmax(0, 1fr); }
.xp i { color: var(--blue); }  /* role */
.xp small { display: block; margin-top: 8px; color: var(--mute); }  /* explainer */
.rec li { grid-template-columns: 16ch minmax(0, 1fr); }
.cv { padding-top: 6px; }
.copy { color: var(--blue); }

/* looping avatar fills whatever room is left; hides (never shrinks) while Experience / Contact is open */
.loop { flex: 1 1 0; min-height: 140px; position: relative; margin-top: 12px; animation: fadein .5s var(--ease); }
.loop video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; mix-blend-mode: multiply; pointer-events: none; }
.side.acc-open .loop { display: none; }
@keyframes fadein { from { opacity: 0; } }

/* live status */
.status { margin-top: auto; border-top: 1px solid var(--ink); }
.side > .acc { margin-bottom: 16px; }
.status-foot { display: none; }
.status li {
  display: flex; justify-content: space-between; align-items: baseline; gap: 2ch;
  padding: 5px 0 4px; border-bottom: 1px solid var(--rule); white-space: nowrap;
}
.status li > span:first-child { color: var(--mute); }
.status li > span:last-child { overflow: hidden; text-overflow: ellipsis; font-variant-numeric: lining-nums tabular-nums; }
.status i { color: var(--mute); }
.up { color: var(--green); }
.down { color: var(--red); }
.live { color: var(--green); }
.live::before { content: "●"; margin-right: .4ch; animation: blink 1.6s steps(1) infinite; }
.closed { color: var(--mute); }
.closed::before { content: "○"; margin-right: .4ch; }
@keyframes blink { 50% { opacity: .2; } }

/* ── right: index ── */
.main { padding: 0 var(--gut); min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }
#work { flex: 1; }
.t2, .r-head {
  display: grid; grid-template-columns: 6ch 64px minmax(0, 1fr) minmax(0, .6fr) 10ch;
  gap: 2ch; align-items: center;
}
.thead {
  position: sticky; top: 0; z-index: 5; background: var(--bg);
  padding-top: var(--gut); border-bottom: 1px solid var(--ink);
}
.t1 { padding-bottom: 8px; border-bottom: 1px solid var(--rule); }
.t2 { padding: 8px 0; color: var(--blue); }

.row { border-bottom: 1px solid var(--rule); }
.r-head { padding: 7px 0 6px; color: var(--ink); text-decoration: none; cursor: pointer; }
.row.open .r-head { color: var(--blue); }
/* hover: text gets a blue highlighter */
.hl { -webkit-box-decoration-break: clone; box-decoration-break: clone; padding: 1px 0; }
@media (hover: hover) { .r-head:hover .hl { background: var(--blue); color: #fff; } .r-head:hover .r-pv { outline-color: var(--blue); } }
.r-n { font-variant-numeric: lining-nums tabular-nums; }
.r-pv { display: block; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; background: #f1f1f1; transition: outline-color .2s; outline: 2px solid transparent; outline-offset: -1px; }
.r-pv img, .r-pv video { display: block; width: 100%; height: 100%; object-fit: cover; }
.row.open .r-pv { outline-color: var(--blue); }
.r-head:focus { outline: none; }
.r-head:focus-visible { outline: 1px dashed var(--blue); outline-offset: 2px; }
.r-c { color: var(--mute); }
.row.open .r-c { color: var(--blue); }
.r-x { text-align: right; white-space: nowrap; }
/* shared "Close ×" button for open projects + open Experience / Contact */
.plus { display: inline-block; }
.cl { display: none; background: var(--blue); color: #fff; padding: 2px 7px; white-space: nowrap; }
.row.open .r-x .plus, .acc-item.open .acc-x .plus { display: none; }
.row.open .r-x .cl, .acc-item.open .acc-x .cl { display: inline-block; }
@media (hover: hover) { .row.open .r-head:hover .cl, .acc-item.open .acc-h:hover .cl { background: var(--ink); } }
/* open project's title row sticks under the column header, so Close is always in reach */
.row.open .r-head { position: sticky; top: var(--thead-h, 50px); z-index: 4; background: var(--bg); border-bottom: 1px solid var(--rule); }

/* expanded project: info first, then media */
.r-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .55s var(--ease); }
.row.open .r-body { grid-template-rows: 1fr; }
.r-inner { overflow: hidden; min-height: 0; }
.r-wrap { padding: 10px 0 28px; }
.r-info { display: flex; justify-content: space-between; align-items: flex-start; gap: 4ch; margin-bottom: 16px; }
.r-copy { max-width: 68ch; line-height: 1.5; }
.r-copy p + p { margin-top: .9em; }
.r-copy a { color: var(--green); }
.r-facts { max-width: 68ch; margin-top: 12px; padding-top: 8px; border-top: 1px solid var(--rule); }
.r-facts p + p { margin-top: 2px; }
.r-facts b { font-weight: 400; color: var(--mute); }
/* project controls: small outlined buttons, same family as Close */
.r-ctrl { display: flex; gap: 6px; align-items: flex-start; flex-shrink: 0; }
.cb { border: 1px solid var(--blue); color: var(--blue); padding: 2px 8px; line-height: 1.5; white-space: nowrap; transition: background .15s, color .15s; }
.cb.ico { padding: 2px 6px; display: inline-flex; align-items: center; }
.cb.ico svg { width: 14px; height: 14px; display: block; margin: 2px 0; }
.cb.done { background: var(--green); border-color: var(--green); color: #fff; }
@media (hover: hover) { .cb:hover { background: var(--blue); color: #fff; } }
.r-media { display: flex; flex-wrap: wrap; gap: 10px; }
.r-media > * { flex: 1 1 100%; }
.r-media .square { flex: 1 1 calc(33.3% - 10px); min-width: 160px; }
.r-media .tall { flex: 0 1 calc(50% - 5px); max-width: 360px; }
.embed { position: relative; width: 100%; background: #000; }
.embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.r-media img { display: block; width: 100%; height: auto; }

.foot { display: flex; justify-content: space-between; gap: 2ch; padding: 14px 0 18px; margin-top: 80px; border-top: 1px solid var(--ink); color: var(--blue); }
.foot a { text-decoration: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .r-body, .acc-b, .more-b { transition: none; }
  .live::before { animation: none; }
}

/* ── small screens ── */
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .side { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--ink); padding-bottom: 14px; }
  .acc { overflow: visible; flex: none; }
  .loop, .side.acc-open .loop { display: block; flex: none; position: static; margin: 18px auto 0; width: min(100%, 360px); aspect-ratio: 1; min-height: 0; }
  .loop video { position: static; }
  .t2, .r-head { grid-template-columns: 5ch 48px minmax(0, 1fr) auto; gap: 1.5ch; }
  .c-client, .r-c { display: none; }
  .side .status { display: none; }
  .status-foot { display: block; margin-top: 56px; }
  .r-info { grid-template-columns: 1fr; gap: 12px; }
  .r-info { flex-direction: column; gap: 12px; }
  .foot { flex-wrap: wrap; margin-top: 24px; }
}
@media (max-width: 420px) {
  .status i { display: none; }
}

/* ── write-ups: Cormorant Garamond italic. Headlines, labels, lists and buttons stay Major Mono ── */
.intro > p, .more-in p, .r-copy, .xp small {
  font-family: var(--body); font-style: italic; font-weight: 400; font-size: var(--fs-body); line-height: 1.32; letter-spacing: 0;
}
.intro .more { font: 400 var(--fs)/1 "Major Mono Display", "Geist Mono", monospace; font-style: normal; margin-left: .3em; vertical-align: .08em; }
.r-copy { max-width: 58ch; }
.xp small { margin-top: 6px; }

/* status values in Cormorant italic; labels stay Major Mono */
.status li > span:last-child { font-family: var(--body); font-style: italic; font-size: 17px; letter-spacing: 0; }
.status li { align-items: center; }

/* Experience: "more" toggle for long client lists */
.clients .cl-more { display: none; }
.clients.open .cl-more { display: inline; }
.more-btn { font: 400 var(--fs)/1 "Major Mono Display", "Geist Mono", monospace; font-style: normal; color: var(--blue); margin-left: .2em; vertical-align: .08em; }
@media (hover: hover) { .more-btn:hover { text-decoration: underline; text-underline-offset: .2em; } }


/* ═════════════════════════════════════════════════════════════
   LOUD THEME — gray page, clashing highlighter blocks.
   Colors are shuffled on every page load by loud.js, so it never looks the same twice.
   Remove class="loud" from <html> to get the plain white version back.
   ═════════════════════════════════════════════════════════════ */
html.loud { --bg: #e8e8e8; --rule: #cfcfcf; --accent: #d6f53a; }
html.loud body { background: var(--bg); }
html.loud .side { border-right-color: var(--rule); }
html.loud .thead, html.loud .row.open .r-head { background: var(--bg); }
html.loud .loop { background: var(--bg); }   /* video multiplies against its own box */

/* any element loud.js tags gets a block: --b background, --f text */
html.loud [data-pop] {
  background: var(--b); color: var(--f, #000) !important; padding: 1px .25em;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
html.loud .t2 > span[data-pop], html.loud .acc-h > span[data-pop] { justify-self: start; }
html.loud .t1 { border-bottom-color: transparent; }
html.loud .t1 > span, html.loud .t2 { color: #000; }
html.loud .r-c, html.loud .row.open .r-c, html.loud .row.open .r-n { color: #000; }
html.loud .r-pv { outline: 0; }
html.loud .acc, html.loud .status, html.loud .foot { border-top-color: #000; }
html.loud .acc-item.open .acc-h { color: #000; }
html.loud .xp small { color: #333; }
html.loud .foot { color: #000; }

/* hover / open: black with the accent color */
@media (hover: hover) {
  html.loud .r-head:hover .hl { background: #000 !important; color: var(--accent) !important; }
  html.loud .r-head:hover .r-pv { outline: 2px solid #000; }
  html.loud .cb:hover { background: #000; color: var(--accent); }
}
html.loud .row.open .r-head .hl { background: #000 !important; color: var(--accent) !important; }

/* buttons */
html.loud .cl { background: #000; color: var(--accent); }
html.loud .cb { border-color: #000; color: #000; background: var(--accent); }

/* status: keep the original layout (label left, value right) — just colored */
html.loud .status li { border-bottom-color: transparent; padding: 3px 0; }
html.loud .status li > span:last-child[data-pop] { padding: 0 .3em; }
html.loud .status i, html.loud .status .up, html.loud .status .down, html.loud .status .live, html.loud .status .closed { color: inherit; }

/* links */
html.loud a.ext, html.loud .r-copy a { color: #000; text-decoration-color: var(--accent2, #ff3b30); text-decoration-thickness: 2px; }

html.loud .tw-cur { color: #000 !important; }

/* mid-size laptops: drop the coordinates so Location never truncates */
@media (min-width: 861px) and (max-width: 1280px) { .status li:nth-child(2) i { display: none; } }
/* big screens: scale the type up a notch */
@media (min-width: 1800px) { :root { --fs: 14px; --fs-body: 21px; } .status li > span:last-child { font-size: 19px !important; } }
@media (min-width: 2400px) { :root { --fs: 16px; --fs-body: 24px; } .status li > span:last-child { font-size: 21px !important; } }

/* layout: "grid3" — 3 per row on desktop, swipeable carousel on phones */
.r-media.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.r-media.grid3 > * { max-width: none; }
.swipe { display: none; }
@media (max-width: 860px) {
  .r-media.grid3 {
    display: flex; flex-wrap: nowrap; overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain;
    margin-right: calc(-1 * var(--gut)); padding-right: var(--gut); scrollbar-width: none;
  }
  .r-media.grid3::-webkit-scrollbar { display: none; }
  .r-media.grid3 > * { flex: 0 0 72%; max-width: none; scroll-snap-align: start; }
  .swipe { display: block; margin: 0 0 8px; color: var(--mute); }
}
.r-copy em { font-style: normal; }   /* titles inside the italic write-ups flip to roman */

/* video facade: poster + play button until clicked */
.facade { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; background: #000; cursor: pointer; display: block; }
.facade img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.facade .play { position: absolute; left: 50%; top: 50%; width: 64px; height: 64px; transform: translate(-50%, -50%); border-radius: 50%; background: rgba(0,0,0,.6); display: grid; place-items: center; transition: transform .15s, background .15s; }
.facade .play svg { width: 26px; height: 26px; fill: #fff; margin-left: 3px; }
.facade:hover .play, .facade:focus-visible .play { transform: translate(-50%, -50%) scale(1.1); background: #000; }
html.loud .facade:hover .play { background: var(--f, #000); }

/* mobile: "Read more" sits on its own line, flush left with the buttons below */
@media (max-width: 860px) {
  .intro .more { display: table; margin: .7em 0 0; }
}

/* effects switch: 🌈 [ o ] ☹️ */
.fx { position: absolute; top: 24px; right: 22px; z-index: 6; display: flex; align-items: center; gap: 6px; padding: 0; border: 0; background: none; cursor: pointer; font-size: 15px; line-height: 1; }
.fx-e { transition: opacity .2s, filter .2s; }
.fx-t { position: relative; width: 38px; height: 20px; border: 1px solid #000; border-radius: 20px; background: var(--accent, var(--blue)); transition: background .2s; }
.fx-k { position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #000; transition: transform .2s var(--ease, ease); }
.fx[aria-checked="false"] .fx-t { background: #fff; }
.fx[aria-checked="false"] .fx-k { transform: translateX(18px); }
.fx[aria-checked="true"] .fx-e:last-child, .fx[aria-checked="false"] .fx-e:first-child { opacity: .35; filter: grayscale(1); }
.fx:focus-visible .fx-t { outline: 2px solid var(--blue); outline-offset: 2px; }
@media (max-width: 860px) { .fx { top: 14px; right: 14px; } }

/* ☹️ mode = dark mode */
html.calm { --bg: #0c0c0c; --ink: #ececec; --mute: #7d7d7d; --rule: #2b2b2b; --blue: #7a85ff; --green: #3ccf6e; color-scheme: dark; }
html.calm body { background: var(--bg); color: var(--ink); }
html.calm .loop { background: var(--bg); }
html.calm .loop video { display: none; }
.loop-photo { display: none; }
html.calm .loop-photo { display: block; position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
@media (max-width: 860px) { html.calm .loop-photo { position: static; } }
html.calm .tw-cur, html.calm ::selection { color: #000 !important; }
html.calm .r-head:hover .hl, html.calm .cl, html.calm .cb:hover { color: #000; }
html.calm .fx-t, html.calm .fx-k { border-color: var(--ink); }
html.calm .fx-k { background: var(--ink); }
html.calm .fx[aria-checked="false"] .fx-t { background: transparent; }
