/* ==========================================================================
   Dev portfolio — styles
   Plain CSS, no build step. Tokens live in :root; change them there.
   ========================================================================== */

:root {
  /* Color */
  --paper: #ECE8DF;       /* page background */
  --ink: #17171A;         /* text, rules, dark bands */
  --ink-soft: #3A3731;    /* body copy */
  --muted: #5A554C;       /* secondary text on paper (≥4.5:1) */
  --muted-dark: #B9B3A7;  /* secondary text on ink */
  --rule: rgba(23, 23, 26, 0.16);
  --rule-strong: rgba(23, 23, 26, 0.28);
  --accent: #C23B22;      /* the one accent. Alternatives: #2F5D50 · #3B4FB8 · #B07A12 */

  /* Type */
  --serif: "Instrument Serif", Georgia, "Times New Roman", serif;
  --sans: "IBM Plex Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Layout */
  --gutter: clamp(20px, 4.5vw, 64px);
  --max: 1440px;
  --ease-out: cubic-bezier(.2, .8, .1, 1);
}

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

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
img { max-width: 100%; display: block; }
h1, h2, h3, h4, p { margin: 0; }
h2.mono-label { font-weight: 400; }
em { font-style: italic; }

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

.skip-link {
  position: absolute; left: var(--gutter); top: -100px;
  padding: 12px 16px; background: var(--ink); color: var(--paper);
  font-family: var(--mono); font-size: 13px; z-index: 10;
}
.skip-link:focus { top: 12px; color: var(--paper); }

.wrap { max-width: var(--max); margin: 0 auto; padding-inline: var(--gutter); }

/* Shared type roles ------------------------------------------------------ */
.mono-label {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.muted { color: var(--muted); }

/* Underline that draws in on hover */
.lnk {
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0 1px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  transition: background-size .3s ease;
}
.lnk:hover, .lnk:focus-visible { background-size: 100% 1px; }

/* Header ----------------------------------------------------------------- */
.site-header { border-bottom: 1px solid var(--rule); }
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 8px 40px; padding-block: 20px;
}
.brand {
  display: flex; align-items: center; gap: 12px; min-height: 44px;
  font-family: var(--serif); font-size: 26px;
}
.brand:hover { color: var(--ink); }
.monogram {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--ink); color: var(--paper);
  font-style: italic; font-size: 16px;
}
.site-nav { display: flex; gap: clamp(20px, 3vw, 40px); }
.site-nav a { padding: 12px 0; }

/* Hero ------------------------------------------------------------------- */
.hero .wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 600px);
  gap: 48px;
  align-items: center;
  padding-block: 56px 40px;
}
.hero-copy { display: flex; flex-direction: column; gap: 36px; }

.status { display: flex; align-items: center; gap: 14px; color: var(--muted); }
.status-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--accent);
  animation: pulse 1.8s ease-out infinite;
}

.hero h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(56px, 8.6vw, 124px);
  line-height: 0.94;
  letter-spacing: -0.02em;
}
.hero h1 .line { display: block; overflow: hidden; padding-bottom: 0.05em; }
.hero h1 .line > span { display: block; animation: rise 1.1s var(--ease-out) both; }
.hero h1 .line:nth-child(2) > span { animation-delay: .13s; }
.hero h1 .line:nth-child(3) > span { animation-delay: .26s; }
.hero h1 .line:nth-child(4) > span { animation-delay: .39s; }
.hero h1 .amp { color: var(--accent); }

.intro { max-width: 32em; font-size: 19px; color: var(--ink-soft); }

.actions { display: flex; flex-wrap: wrap; gap: 16px; }
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 48px; padding: 0 24px; border-radius: 999px;
  border: 1px solid var(--ink);
  font-family: var(--mono); font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase;
  transition: background-color .2s ease, color .2s ease;
}
.btn-solid { background: var(--ink); color: var(--paper); }
.btn-solid:hover { background: var(--accent); border-color: var(--accent); color: var(--paper); }
.btn-ghost:hover { background: var(--ink); color: var(--paper); }

.fade { animation: fade 1.4s ease both; }
.fade-1 { animation-delay: .6s; }
.fade-2 { animation-delay: .75s; }

/* The orrery ------------------------------------------------------------- */
/* Everything is sized in % of a square, so it scales with its column.
   Ring diameters: 85 / 65 / 45 / 25 % — orbit periods: 63 / 41 / 26 / 14 s. */
.orrery {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  animation: fade 1.4s ease .2s both;
}
.axis { position: absolute; border: 0 dashed rgba(23, 23, 26, 0.18); }
.axis-x { left: 0; right: 0; top: 50%; border-top-width: 1px; }
.axis-y { top: 0; bottom: 0; left: 50%; border-left-width: 1px; }
.deg { position: absolute; font-family: var(--mono); font-size: 10px; color: var(--muted); }
.deg-270 { left: 1%; top: 47.3%; }
.deg-90  { right: 1%; top: 47.3%; }
.deg-180 { left: 51.3%; bottom: 0.7%; }

.ring {
  position: absolute;
  left: 50%; top: 50%;
  width: var(--d); height: var(--d);
  transform: translate(-50%, -50%);
  border: 1px solid var(--rule-strong);
  border-radius: 50%;
}
.ring.dashed { border-style: dashed; border-color: rgba(23, 23, 26, 0.34); }
.ring-1 { --d: 25%; }
.ring-2 { --d: 45%; }
.ring-3 { --d: 65%; }
.ring-4 { --d: 85%; }

/* An arm is the full ring box spinning; its planet sits at 12 o'clock. */
/* --a is the resting angle, used when motion is reduced. */
.arm { position: absolute; inset: 0; transform: rotate(var(--a, 0deg)); animation: spin var(--t) linear infinite; animation-delay: var(--start, 0s); }
.arm.ccw { animation-direction: reverse; }
.ring-1 .arm { --t: 14s; }
.ring-2 .arm { --t: 26s; }
.ring-3 .arm { --t: 41s; }
.ring-4 .arm { --t: 63s; }

.planet {
  position: absolute; left: 50%; top: 0;
  width: var(--s, 10px); height: var(--s, 10px);
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: var(--ink);
}
.planet.hollow { background: var(--paper); border: 1.5px solid var(--ink); }
.planet.accent { background: var(--accent); }
.planet.accent.hollow { background: var(--paper); border-color: var(--accent); }

.sweep {
  position: absolute; inset: 7.5%;
  transform: rotate(-40deg);
  animation: spin 9s linear infinite;
}
.sweep::before {
  content: ""; position: absolute; left: 50%; top: 0;
  width: 1px; height: 50%; background: var(--accent); opacity: .55;
}

.core {
  position: absolute; left: 50%; top: 50%;
  width: 9.33%; aspect-ratio: 1; transform: translate(-50%, -50%);
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: var(--ink); color: var(--paper);
  font-family: var(--serif); font-style: italic; font-size: clamp(16px, 2.2vw, 24px);
}

.ring-label {
  position: absolute; left: 50%;
  transform: translate(-50%, -50%);
  padding: 2px 7px;
  background: var(--paper);
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase;
  white-space: nowrap;
}
.ring-label.l1 { top: 37.5%; }
.ring-label.l2 { top: 27.5%; }
.ring-label.l3 { top: 17.5%; }
.ring-label.l4 { top: 7.5%; }

/* Ticker ------------------------------------------------------------------ */
.ticker { overflow: hidden; background: var(--ink); color: var(--paper); border-block: 1px solid var(--ink); }
.ticker-track { display: flex; width: max-content; animation: marquee 38s linear infinite; }
.ticker-track ul {
  display: flex; gap: 48px; margin: 0; padding: 18px 24px; list-style: none;
  font-family: var(--mono); font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase;
}
.ticker-track li { display: flex; gap: 48px; white-space: nowrap; }
.ticker-track li::after { content: "✳"; color: var(--accent); }
.ticker:hover .ticker-track { animation-play-state: paused; }

/* Section heads ---------------------------------------------------------- */
.section-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  flex-wrap: wrap; gap: 24px;
}
.section-head h2 {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(52px, 6.2vw, 88px); line-height: 1; letter-spacing: -0.02em;
}
.section-head h2 em { color: var(--accent); }
.section-head .count { font-family: var(--mono); font-size: 16px; vertical-align: top; letter-spacing: 0; }
.section-head p { max-width: 340px; font-size: 16px; color: var(--muted); }

/* Selected work ---------------------------------------------------------- */
.work .wrap { display: flex; flex-direction: column; gap: 48px; padding-block: 112px 96px; }
.work-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--ink); }
.row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) minmax(0, 360px) 220px 80px 32px;
  gap: 24px; align-items: center;
  padding: 36px 16px;
  border-bottom: 1px solid var(--ink);
  transition: background-color .35s ease, color .35s ease;
}
.row:hover, .row:focus-visible { background: var(--ink); color: var(--paper); outline-offset: -2px; }
.row .num, .row .year { font-family: var(--mono); font-size: 13px; }
.row .title { font-family: var(--serif); font-size: 46px; line-height: 1; }
.row .desc { font-size: 15px; color: var(--muted); transition: color .35s ease; }
.row:hover .desc, .row:focus-visible .desc { color: var(--muted-dark); }
.row .stack { font-family: var(--mono); font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; }
.row .arrow { transition: transform .35s var(--ease-out); }
.row:hover .arrow, .row:focus-visible .arrow { transform: translate(6px, -6px); }

/* Build notes ------------------------------------------------------------ */
.builds { border-top: 1px solid var(--rule); }
.builds .wrap { display: flex; flex-direction: column; gap: 56px; padding-block: 112px 40px; }

.build {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 24px; row-gap: 32px;
  padding-block: 72px;
  border-top: 1px solid var(--ink);
  scroll-margin-top: 24px;
}
.build-meta { grid-column: span 4; display: flex; flex-direction: column; gap: 20px; padding-right: 24px; }
.build-meta .num { font-family: var(--mono); font-size: 13px; }
.build-meta h3 {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(44px, 4.2vw, 60px); line-height: 1; letter-spacing: -0.01em;
}
.build-meta .stack { font-family: var(--mono); font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; }
.build-links { display: flex; gap: 28px; }
.build-links a { padding: 12px 0; }

.build-body { grid-column: span 8; display: flex; flex-direction: column; gap: 36px; }
.build-figure {
  margin: 0; min-height: 320px;
  display: flex; align-items: center; justify-content: center;
  border: 1px dashed rgba(23, 23, 26, 0.4);
  background: rgba(23, 23, 26, 0.035);
  font-family: var(--mono); font-size: 13px; color: var(--muted);
}
/* Once you add a real image, the dashed placeholder styling drops away: */
.build-figure:has(img) { border: 0; background: none; min-height: 0; }

.build-notes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 36px 40px; }
.build-notes > div { display: flex; flex-direction: column; gap: 12px; padding-top: 16px; border-top: 1px solid var(--rule); }
.build-notes h4 {
  font-family: var(--mono); font-weight: 400; font-size: 12px;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted);
}
.build-notes p { font-size: 16px; line-height: 1.65; color: var(--ink-soft); }

/* About ------------------------------------------------------------------ */
.about { border-top: 1px solid var(--rule); }
.about .wrap {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 24px; row-gap: 32px; padding-block: 96px;
}
.about-label { grid-column: span 2; color: var(--muted); }
.about-copy { grid-column: span 6; display: flex; flex-direction: column; gap: 28px; }
.about-lede { font-family: var(--serif); font-size: clamp(30px, 3.1vw, 44px); line-height: 1.15; letter-spacing: -0.01em; }
.about-lede em { color: var(--accent); }
.about-copy p:not(.about-lede) { max-width: 560px; font-size: 17px; line-height: 1.65; color: var(--ink-soft); }

.experience { grid-column: span 4; padding-left: 24px; }
.experience h2 { font-weight: 400; color: var(--muted); padding-bottom: 16px; border-bottom: 1px solid var(--ink); }
.experience ol { list-style: none; margin: 0; padding: 0; }
.experience li {
  display: flex; justify-content: space-between; gap: 16px;
  padding: 20px 0; border-bottom: 1px solid var(--rule);
}
.experience .co { display: block; font-size: 17px; font-weight: 500; }
.experience .role { display: block; font-size: 15px; color: var(--muted); }
.experience .when { font-family: var(--mono); font-size: 13px; white-space: nowrap; }

/* Footer / contact ------------------------------------------------------- */
.site-footer { background: var(--ink); color: var(--paper); }
.site-footer a:hover { color: var(--paper); }
.site-footer .wrap { display: flex; flex-direction: column; gap: 64px; padding-block: 96px 40px; }
.contact { display: flex; flex-direction: column; gap: 28px; }
.contact .mono-label, .footer-bar .muted-dark { color: var(--muted-dark); }
.say-hello {
  align-self: flex-start;
  font-family: var(--serif);
  font-size: clamp(72px, 10.3vw, 148px); line-height: 1; letter-spacing: -0.03em;
}
.say-hello em { color: var(--accent); }
.email { font-family: var(--mono); font-size: 18px; }

.colophon {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 24px; row-gap: 16px; align-items: baseline;
  padding-top: 28px; border-top: 1px solid rgba(236, 232, 223, 0.25);
}
.colophon .mono-label { grid-column: span 2; color: var(--muted-dark); }
.colophon p { grid-column: span 8; font-family: var(--serif); font-size: clamp(26px, 2.5vw, 36px); line-height: 1.2; }
/* Accent on dark needs to stay ≥3:1 for large text; #C23B22 on #17171A ≈ 3.4:1. */
.colophon em { color: var(--accent); }

.footer-bar {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 16px 36px; padding-top: 28px;
}
.footer-bar nav { display: flex; flex-wrap: wrap; gap: 8px 36px; }
.footer-bar nav a { padding: 12px 0; }

/* Motion ----------------------------------------------------------------- */
@keyframes spin    { to { transform: rotate(360deg); } }
@keyframes rise    { from { transform: translateY(108%); } to { transform: translateY(0); } }
@keyframes fade    { from { opacity: 0; } to { opacity: 1; } }
@keyframes marquee { to { transform: translateX(-50%); } }
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 45%, transparent); }
  100% { box-shadow: 0 0 0 12px color-mix(in srgb, var(--accent) 0%, transparent); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* Responsive ------------------------------------------------------------- */
@media (max-width: 1180px) {
  .row { grid-template-columns: 56px minmax(0, 1fr) minmax(0, 300px) 32px; }
  .row .stack, .row .year { display: none; }
}

@media (max-width: 980px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .orrery { max-width: 520px; justify-self: center; }

  .build-meta, .build-body { grid-column: 1 / -1; padding-right: 0; }

  .about-label, .about-copy, .experience { grid-column: 1 / -1; padding-left: 0; }

  .colophon .mono-label, .colophon p { grid-column: 1 / -1; }
}

@media (max-width: 720px) {
  body { font-size: 16px; }
  .hero .wrap { padding-block: 40px 32px; }
  .intro { font-size: 17px; }

  .row {
    grid-template-columns: 40px minmax(0, 1fr) 24px;
    padding: 28px 8px; gap: 8px 16px;
  }
  .row .title { font-size: 34px; }
  .row .desc { grid-column: 2 / 3; }
  .row .arrow { grid-row: 1; grid-column: 3; }

  .work .wrap, .builds .wrap { padding-block: 72px 56px; }
  .build { padding-block: 48px; }
  .build-figure { min-height: 200px; }
  .build-notes { grid-template-columns: 1fr; }

  .about .wrap, .site-footer .wrap { padding-block: 72px 32px; }
}

/* ==========================================================================
   Albemuth page
   ========================================================================== */

/* Intro ------------------------------------------------------------------- */

.alb-intro .wrap { padding-block: 80px 64px; max-width: 760px; }
.alb-back        { margin-bottom: 2rem; }
.alb-title       { font-family: var(--serif); font-size: clamp(48px, 7vw, 96px);
                   line-height: 1.05; color: var(--ink); margin-bottom: 1.5rem; font-weight: normal; }
.alb-lede        { font-family: var(--sans); font-size: clamp(17px, 2vw, 20px);
                   line-height: 1.65; color: var(--ink-soft); margin-bottom: 1.25rem; }
.alb-sub         { font-size: 12px; color: var(--muted); font-style: normal; }
.alb-sub em      { font-style: italic; }

/* Section label ----------------------------------------------------------- */

.alb-section-label {
  font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 2rem;
  padding-bottom: 0.75rem; border-bottom: 1px solid var(--rule-strong);
}

/* Article ----------------------------------------------------------------- */

.alb-transmission .wrap { padding-block: 0 80px; max-width: 720px; }

.alb-article {
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.75;
  color: var(--ink-soft);
}
.alb-article h1 {
  font-family: var(--serif);
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.2;
  color: var(--ink);
  font-weight: normal;
  margin-bottom: 1.5rem;
}
.alb-article h2 {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin: 2.5rem 0 0.75rem;
}
.alb-article p  { margin-bottom: 1.1rem; }
.alb-article em { font-style: italic; }
.alb-article ul { margin: 0.5rem 0 1.25rem 1.25rem; }
.alb-article li { margin-bottom: 0.5rem; }
.alb-article a  { color: var(--accent); text-decoration: none;
                  background-image: linear-gradient(var(--accent), var(--accent));
                  background-size: 0 1px; background-position: 0 100%; background-repeat: no-repeat;
                  transition: background-size .25s ease; }
.alb-article a:hover { background-size: 100% 1px; }

.alb-article .meta {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  margin-top: 2.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--rule);
}
.alb-article footer {
  margin-top: 0.5rem;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
}
.alb-article footer a { color: var(--muted); background-image: linear-gradient(var(--muted), var(--muted)); }

/* About the system -------------------------------------------------------- */

.alb-about { background: var(--ink); color: var(--muted-dark); }
.alb-about .wrap { padding-block: 64px; }
.alb-about .alb-section-label { color: var(--muted-dark); border-bottom-color: rgba(255,255,255,0.12); }

.alb-system-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem 3rem;
  margin-bottom: 2.5rem;
}
.alb-system-grid h3 {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--paper);
  margin-bottom: 0.6rem;
}
.alb-system-grid p {
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.65;
  color: var(--muted-dark);
}
.alb-build-link { font-size: 12px; }
.alb-build-link a { color: var(--muted-dark); }
.alb-build-link a:hover { color: var(--paper); }

/* Archive list ------------------------------------------------------------ */

.alb-archive .wrap { padding-block: 0 64px; }

.alb-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.alb-list li + li { border-top: 1px solid var(--rule); }

.alb-list-row {
  display: flex;
  align-items: baseline;
  gap: 1.25rem;
  padding: 1.1rem 0;
  text-decoration: none;
  color: inherit;
  transition: color .18s ease;
}
.alb-list-row:hover { color: var(--accent); }

.alb-list-date {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
  padding-top: 2px;
}
.alb-list-row:hover .alb-list-date { color: var(--accent); opacity: 0.7; }

.alb-list-title {
  font-family: var(--serif);
  font-size: 1.15rem;
  flex: 1;
  min-width: 0;
}

.alb-list-byline {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.alb-list-arrow {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
  flex-shrink: 0;
  transition: transform .18s ease, color .18s ease;
}
.alb-list-row:hover .alb-list-arrow {
  color: var(--accent);
  transform: translateX(3px);
}

/* Individual post page ---------------------------------------------------- */

.alb-post .wrap { padding-block: 56px 80px; }

/* Mobile ------------------------------------------------------------------ */

@media (max-width: 720px) {
  .alb-intro .wrap  { padding-block: 48px 40px; }
  .alb-system-grid  { grid-template-columns: 1fr; gap: 1.5rem; }
  .alb-list-byline  { display: none; }
  .alb-post .wrap   { padding-block: 40px 56px; }
}
