/* Ashleyn Castelino — portfolio.
   One typeface family doing two jobs: Archivo at width 118 for display, Archivo
   at normal width for reading, JetBrains Mono only for data (dates, stacks,
   proof). Vermilion means "you can click this"; amber means "this is a fact".
   Every colour below is checked against WCAG AA on its own background. */

:root {
  color-scheme: dark;

  --bg: #131211;
  --surface: #1c1a19;
  --raised: #232120;
  --sunk: #17161a;

  --line: #322e2c;
  --line-hi: #46403b;

  --text: #f6f4f2;      /* 15.8 on surface */
  --text-2: #c4bdb6;    /*  9.3 */
  --text-3: #97908a;    /*  5.5 */

  --flame: #ec3013;     /* the mark — graphics only */
  --flame-tx: #ff6b45;  /*  6.1 — the same red, legible at 12px */
  --amber: #e8bf58;     /*  9.9 — reserved for proof */

  --measure: 62ch;
  --tick: 96px;         /* the right-hand column every date lines up in */
  --ease: cubic-bezier(.2, .7, .2, 1);
}

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

body {
  margin: 0;
  background: var(--bg);
  font-family: Archivo, system-ui, sans-serif;
  font-size: 15.5px;
  color: var(--text-2);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--flame-tx); text-decoration: none; }
a:hover { color: #ff8f70; }
a:focus-visible, [tabindex]:focus-visible, summary:focus-visible {
  outline: 2px solid var(--flame-tx);
  outline-offset: 3px;
  border-radius: 1px;
}
::selection { background: var(--flame); color: #fff; }
img, video { max-width: 100%; }

/* ---- shell ---------------------------------------------------------- */

.frame {
  background: var(--surface);
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  display: grid;
  grid-template-columns: 300px 1fr;
  min-height: 100vh;
  max-width: 1340px;
  margin: 0 auto;
}

.rail {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  padding: 44px 34px 34px;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 34px;
  overflow-y: auto;
}

.col {
  padding: 44px 60px 110px;
  display: flex;
  flex-direction: column;
  gap: 86px;
  min-width: 0;
}

/* ---- rail identity --------------------------------------------------- */

.mark {
  width: 32px;
  height: 32px;
  background: var(--flame);
  color: #17100e;
  display: grid;
  place-items: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: .04em;
}

.rail-name {
  margin: 14px 0 10px;
  font-size: 25px;
  font-weight: 600;
  font-variation-settings: 'wdth' 112;
  letter-spacing: -.02em;
  line-height: 1.08;
  color: var(--text);
}

.rail-what {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  line-height: 1.75;
  color: var(--text-3);
}

/* ---- rail index: the count is the point, not the ordinal ------------- */

.index { margin-top: 30px; display: flex; flex-direction: column; }

/* the project pages reuse .nav-item with the number first, so the grid layout
   below is scoped to the home page's index only */
.nav-item {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 9px 0 9px 12px;
  margin-left: -12px;
  border-left: 2px solid transparent;
  font-size: 14.5px;
  color: var(--text-3);
  transition: color .16s var(--ease), border-color .16s var(--ease);
}
.index .nav-item {
  display: grid;
  grid-template-columns: 1fr auto;
  border-top: 1px solid var(--line);
}
.index .nav-item:last-child { border-bottom: 1px solid var(--line); }
.nav-item:hover { color: var(--text); }
.nav-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
  color: #6f6963;
  transition: color .16s var(--ease);
}
.nav-item:hover .nav-num { color: var(--flame-tx); }
.rail .nav-item.active { color: var(--text); border-left-color: var(--flame); }
.rail .nav-item.active .nav-num { color: var(--flame-tx); }

.rail-foot {
  display: flex;
  flex-direction: column;
  gap: 14px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
}

.status { display: flex; align-items: center; gap: 9px; color: var(--flame-tx); }
.status::before {
  content: "";
  width: 7px;
  height: 7px;
  background: var(--flame);
}

.socials { display: flex; gap: 16px; align-items: center; }
.icon-link {
  display: inline-flex;
  color: var(--text-3);
  transition: color .16s var(--ease), transform .16s var(--ease);
}
.icon-link:hover { color: var(--flame-tx); transform: translateY(-2px); }

/* ---- hero: the thesis is the page's first fact, not the name --------- */

.hero {
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 14px 0 34px;
  border-bottom: 1px solid var(--line);
}

.hero-tail {
  margin: -6px 0 0;
  max-width: 46ch;
  font-size: 17px;
  line-height: 1.55;
  color: var(--text-2);
  text-wrap: pretty;
}

/* the sentence recedes; the three subjects it names carry the weight */
.hero-thesis {
  margin: 0;
  max-width: 27ch;
  font-size: clamp(28px, 3.5vw, 44px);
  font-weight: 300;
  font-variation-settings: 'wdth' 104;
  letter-spacing: -.032em;
  line-height: 1.12;
  color: var(--text-3);
  text-wrap: pretty;
}
.hero-thesis em {
  font-style: normal;
  font-weight: 600;
  font-variation-settings: 'wdth' 118;
  color: var(--text);
}

/* the signature: hard numbers, pulled out of the prose and set as data */
.receipts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 4px;
}

.proof {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 10px 5px 9px;
  border: 1px solid rgba(232, 191, 88, .32);
  background: rgba(232, 191, 88, .05);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--amber);
  white-space: nowrap;
}
.proof::before {
  content: "";
  width: 4px;
  height: 4px;
  background: var(--amber);
  transform: rotate(45deg);
  flex: none;
}
/* inline in a list row, it should sit quietly next to the text */
.rowmain .proof, .cbody .proof { align-self: flex-start; }

/* ---- section heads --------------------------------------------------- */

.sec { display: flex; flex-direction: column; gap: 22px; scroll-margin-top: 28px; }

.sec-head {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--line-hi);
}

.eyebrow {
  display: block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--flame-tx);
}

.sec-title {
  margin: 0;
  font-size: clamp(26px, 3vw, 34px);
  font-weight: 600;
  font-variation-settings: 'wdth' 112;
  letter-spacing: -.03em;
  line-height: 1;
  color: var(--text);
}

.sec-count {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
  letter-spacing: .08em;
  color: var(--text-3);
  white-space: nowrap;
}

/* ---- list rows: one grid, one tick column for every date ------------- */

.list { display: flex; flex-direction: column; }

.xrow, .row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--tick);
  align-items: start;
  gap: 24px;
  padding: 20px 0 20px 14px;
  margin-left: -14px;
  border-bottom: 1px solid var(--line);
  position: relative;
  transition: background-color .18s var(--ease);
}
.list > .xrow:first-child, .list > .row:first-child { border-top: 1px solid var(--line); }

/* the hover bar lives in a pseudo-element, so nothing reflows */
.xrow::before, .row::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--flame);
  transform: scaleY(0);
  transform-origin: 50% 0;
  transition: transform .22s var(--ease);
}
.xrow:hover::before, .row:hover::before { transform: scaleY(1); }
.xrow:hover, .row:hover { background: rgba(255, 255, 255, .022); }

.rowmain { display: flex; flex-direction: column; gap: 7px; min-width: 0; }

.rt, .xt {
  font-size: 19px;
  font-weight: 500;
  letter-spacing: -.015em;
  color: var(--text);
}
.xt { font-size: 18px; }

.org {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  letter-spacing: .02em;
  color: var(--text-3);
}
.org strong { color: var(--flame-tx); font-weight: 400; }

.lede {
  max-width: var(--measure);
  font-size: 15.5px;
  line-height: 1.62;
  color: var(--text-2);
}

.when, .w-date {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  letter-spacing: .04em;
  color: var(--text-3);
  white-space: nowrap;
  text-align: right;
}

/* writing rows: title left, date on the same tick */
.row { padding: 15px 0 15px 14px; align-items: baseline; }
.w-title {
  font-size: 17px;
  line-height: 1.4;
  color: var(--text-2);
  transition: color .16s var(--ease);
}
.row:hover .w-title { color: var(--text); }

/* ---- link clusters --------------------------------------------------- */

.lnks { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 2px; }

.lnk {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  letter-spacing: .02em;
  color: var(--flame-tx);
  border-bottom: 1px solid transparent;
  transition: border-color .16s var(--ease);
}
.lnk:hover { border-bottom-color: currentColor; }

.app-line {
  display: block;
  max-width: var(--measure);
  margin-top: 8px;
  padding-left: 14px;
  border-left: 1px solid var(--line-hi);
  font-size: 15px;
  line-height: 1.62;
  color: var(--text-2);
}
.nm { color: var(--text); font-weight: 500; }

/* ---- cards ----------------------------------------------------------- */

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }

.card {
  display: flex;
  flex-direction: column;
  background: var(--raised);
  border: 1px solid var(--line);
  transition: border-color .2s var(--ease), transform .2s var(--ease), box-shadow .2s var(--ease);
}
.card:hover {
  border-color: var(--line-hi);
  transform: translateY(-3px);
  box-shadow: 0 14px 30px -18px rgba(0, 0, 0, .9);
}

.media { display: block; border-bottom: 1px solid var(--line); background: var(--sunk); }
.vid, .img-c {
  width: 100%;
  aspect-ratio: 16 / 9;
  display: block;
  background: var(--sunk);
}
.vid { object-fit: contain; }
.img-c { object-fit: cover; object-position: 50% 35%; filter: grayscale(1) contrast(1.05); transition: filter .3s var(--ease); }
.card:hover .img-c { filter: grayscale(.35) contrast(1.05); }
.img-fill {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 35%;
  filter: grayscale(1) contrast(1.05);
  display: block;
}

.cbody { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 9px; }

.card-title {
  font-size: 19px;
  font-weight: 500;
  letter-spacing: -.015em;
  color: var(--text);
  transition: color .16s var(--ease);
}
.card-title:hover { color: var(--flame-tx); }

.csum { font-size: 15px; line-height: 1.55; color: var(--text-2); }

.stack {
  margin-top: auto;
  padding-top: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
  letter-spacing: .04em;
  color: var(--text-3);
}

/* ---- press: media left, text stretched across the rest --------------- */

.press-list { display: flex; flex-direction: column; gap: 18px; }
.press-card { display: grid; grid-template-columns: 300px 1fr; }
/* a fixed media height keeps a tall photo from stretching the whole row */
.press-card > .slot,
.press-card > .media {
  border-bottom: 0;
  border-right: 1px solid var(--line);
  height: 200px;
  align-self: stretch;
  min-height: 100%;
  overflow: hidden;
}
.press-card > .media img { height: 100%; aspect-ratio: auto; }
.press-card > .slot { aspect-ratio: auto; gap: 10px; }
/* the date is the card's footer, but only when there's room for one */
.press-card .stack { margin-top: auto; }
.press-card > .slot .slot-play { width: 30px; height: 30px; }
.press-card > .slot .slot-label { display: none; }

/* ---- demo slots: the fallback when a media file is missing ----------- */

.slot {
  position: relative;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  aspect-ratio: 16 / 9;
  background:
    repeating-linear-gradient(135deg, #2a2725 0 8px, #232120 8px 16px);
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background-color .15s var(--ease);
}
.slot:hover { background-color: #2f2b28; }

.slot-play {
  width: 34px;
  height: 34px;
  background: var(--flame);
  clip-path: polygon(0 0, 100% 50%, 0 100%);
  transition: transform .15s var(--ease);
}
.slot:hover .slot-play { transform: scale(1.15); }

.slot-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
  letter-spacing: .1em;
  color: var(--text-3);
}
.slot-cue {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--flame-tx);
  border-bottom: 1px dashed currentColor;
  padding-bottom: 2px;
}
.slot:hover .slot-cue { border-bottom-style: solid; }

.slot-wide { aspect-ratio: auto; height: 240px; border: 1px solid var(--line); }

/* the wide banner images above talks */
.banner {
  width: 100%;
  height: 300px;
  object-fit: cover;
  filter: grayscale(1) contrast(1.05);
  border: 1px solid var(--line);
  display: block;
  transition: filter .35s var(--ease);
}
.banner:hover { filter: grayscale(.3) contrast(1.05); }

/* ---- group labels: tech / finance ------------------------------------ */

.subhead {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--text-3);
}
.subhead::before {
  content: "";
  width: 18px;
  height: 1px;
  background: var(--line-hi);
}

/* ---- progressive disclosure ------------------------------------------ */

.more { border: 0; }
.more summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 0 0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  letter-spacing: .06em;
  color: var(--flame-tx);
  transition: color .16s var(--ease);
}
.more summary::-webkit-details-marker { display: none; }
.more summary:hover { color: #ff8f70; }
.more-close { display: none; }
/* ponytail: child selectors, not descendant — a nested <details class="more">
   keeps its own open/close label instead of inheriting the outer one's state. */
.more[open] > summary .more-open { display: none; }
.more[open] > summary .more-close { display: inline; }
.more-grid > .grid, .more-grid > .press-list { margin-top: 18px; }

.more-inline { display: flex; flex-direction: column; gap: 2px; }
.more-inline summary { padding: 8px 0 0; font-size: 11.5px; }

/* ---- scroll reveal ---------------------------------------------------- */

[data-reveal] {
  opacity: 0;
  transform: translateY(9px);
  transition: opacity .38s var(--ease), transform .38s var(--ease);
}
[data-reveal].in { opacity: 1; transform: none; }

/* the hero doesn't wait for a scroll — it plays on load */
.hero > * {
  opacity: 0;
  animation: rise .7s var(--ease) forwards;
}
.hero > :nth-child(1) { animation-delay: .05s; }
.hero > :nth-child(2) { animation-delay: .16s; }
.hero > :nth-child(3) { animation-delay: .26s; }
.hero > :nth-child(4) { animation-delay: .34s; }
@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: none; }
}

/* ---- published articles (see publish.py) ----------------------------- */

.a-head { display: flex; flex-direction: column; gap: 14px; }
.a-title {
  margin: 0;
  max-width: 22ch;
  font-size: clamp(30px, 3.8vw, 46px);
  font-weight: 600;
  font-variation-settings: 'wdth' 110;
  letter-spacing: -.034em;
  line-height: 1.08;
  color: var(--text);
  text-wrap: pretty;
}
.nav-item.back { padding-left: 0; margin-left: 0; margin-bottom: 22px; font-size: 13px; }

.a-body { display: flex; flex-direction: column; gap: 18px; max-width: 66ch; }
.a-p { margin: 0; font-size: 17px; line-height: 1.75; color: var(--text-2); }
.a-h {
  margin: 20px 0 0;
  font-size: 22px;
  font-weight: 600;
  font-variation-settings: 'wdth' 110;
  letter-spacing: -.02em;
  line-height: 1.28;
  color: var(--text);
}
.a-body h3.a-h { font-size: 19px; }
.a-body h4.a-h { font-size: 16.5px; color: var(--text-2); }
.a-ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; }
.a-ul li { font-size: 17px; line-height: 1.7; color: var(--text-2); }
.a-ul li::marker { color: var(--flame-tx); }
.a-quote {
  margin: 0;
  border-left: 2px solid var(--flame);
  padding: 2px 0 2px 18px;
  font-size: 17px;
  line-height: 1.6;
  color: var(--text);
}
.a-code {
  margin: 0;
  border: 1px solid var(--line);
  background: var(--sunk);
  padding: 16px 18px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--text-2);
  overflow-x: auto;
}
.a-body code { font-family: 'JetBrains Mono', monospace; font-size: .92em; color: var(--text); }

/* ---- responsive ------------------------------------------------------- */

@media (max-width: 1180px) {
  .col { padding: 40px 40px 90px; }
  .press-card { grid-template-columns: 240px 1fr; }
}

@media (max-width: 900px) {
  .frame { grid-template-columns: 1fr; border: 0; }
  .rail {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 30px 24px;
  }
  .index { margin-top: 22px; }
  .col { padding: 34px 24px 70px; gap: 60px; }
  .grid { grid-template-columns: 1fr; }
  .press-card { grid-template-columns: 1fr; }
  .press-card > .slot, .press-card > .media {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .press-card > .media img { aspect-ratio: 16 / 9; height: auto; }
  .banner { height: 200px; }
}

@media (max-width: 620px) {
  :root { --tick: auto; }
  .xrow, .row { grid-template-columns: 1fr; gap: 8px; }
  .when, .w-date { text-align: left; order: -1; }
  .row { gap: 4px; }
}

@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1 !important; transform: none !important; }
  .hero > * { opacity: 1; animation: none; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}
