/* ==========================================================================
   anthonyellis.dev — shared stylesheet
   One file, no dependencies, no webfonts. Dark technical theme.
   ========================================================================== */

:root {
  --bg: #070a10;
  --bg-2: #0b111b;
  --panel: #0e1420;
  --panel-hi: #131c2b;
  --line: #1e2a3a;
  --line-hi: #2c3d54;
  --text: #e8edf5;
  --dim: #94a4bb;
  --faint: #6b7c93;
  --accent: #4da3ff;
  --accent-2: #6ad5ff;
  --good: #3ddc97;
  --radius: 12px;
  --maxw: 1080px;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* Ambient backdrop — two soft radial washes, no animation, no cost. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(900px 600px at 78% -8%, rgba(77, 163, 255, 0.10), transparent 70%),
    radial-gradient(700px 500px at 8% 4%, rgba(106, 213, 255, 0.06), transparent 70%);
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-2); }
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 3px;
  border-radius: 4px;
}

::selection { background: rgba(77, 163, 255, 0.3); }

.wrap { max-width: var(--maxw); margin: 0 auto; padding-left: 24px; padding-right: 24px; }

.skip {
  position: absolute; left: -9999px;
}
.skip:focus {
  left: 16px; top: 16px; z-index: 50;
  background: var(--panel); border: 1px solid var(--line-hi);
  padding: 10px 14px; border-radius: 8px;
}

/* ---------------------------------------------------------------- site nav */
.topbar {
  border-bottom: 1px solid var(--line);
  background: rgba(7, 10, 16, 0.72);
  backdrop-filter: blur(10px);
  position: sticky; top: 0; z-index: 20;
}
.topbar .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; height: 60px;
}
.mark {
  font-family: var(--mono);
  font-size: 0.86rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text);
  display: inline-flex; align-items: center; gap: 9px;
}
.mark .glyph {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
  flex: 0 0 auto;
}
.navlinks { display: flex; gap: 22px; font-size: 0.9rem; }
.navlinks a { color: var(--dim); }
.navlinks a:hover { color: var(--text); }

/* ------------------------------------------------------------------- hero */
.hero { padding: 88px 0 56px; }
.eyebrow {
  font-family: var(--mono);
  font-size: 0.76rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 18px;
}
.hero h1 {
  font-size: clamp(2.4rem, 6vw, 3.9rem);
  line-height: 1.05;
  letter-spacing: -0.025em;
  margin: 0 0 18px;
  font-weight: 700;
}
.hero .lede {
  font-size: clamp(1.05rem, 2.2vw, 1.28rem);
  color: var(--dim);
  max-width: 60ch;
  margin: 0 0 30px;
}
.hero .lede strong { color: var(--text); font-weight: 600; }

.cta-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

.btn {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 11px 18px;
  border-radius: 9px;
  border: 1px solid var(--line-hi);
  background: var(--panel-hi);
  color: var(--text);
  font-size: 0.93rem;
  font-weight: 550;
  transition: background 0.16s, border-color 0.16s, transform 0.06s;
}
.btn:hover { background: #18243a; border-color: #3b567a; color: var(--text); }
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: linear-gradient(180deg, #2f7fd8, #1d5fae);
  border-color: #4f9de6;
  color: #fff;
  box-shadow: 0 6px 22px rgba(45, 120, 210, 0.28);
}
.btn-primary:hover { background: linear-gradient(180deg, #3b8ee8, #2469bd); color: #fff; }
.btn .arrow { transition: transform 0.16s; }
.btn:hover .arrow { transform: translateX(3px); }

/* ------------------------------------------------------------------ chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0; list-style: none; }
.chip {
  font-family: var(--mono);
  font-size: 0.73rem;
  letter-spacing: 0.06em;
  color: var(--dim);
  background: rgba(19, 28, 43, 0.8);
  border: 1px solid var(--line);
  padding: 5px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

/* --------------------------------------------------------------- sections */
section { padding: 52px 0; }
.section-head {
  display: flex; align-items: baseline; gap: 14px;
  margin-bottom: 26px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.section-head h2 {
  font-size: 1.02rem;
  font-family: var(--mono);
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text);
  margin: 0;
}
.section-head .count { font-family: var(--mono); font-size: 0.78rem; color: var(--faint); }

.prose { max-width: 68ch; color: var(--dim); }
.prose p { margin: 0 0 16px; }
.prose strong { color: var(--text); font-weight: 600; }
.prose code {
  font-family: var(--mono); font-size: 0.86em;
  background: var(--panel); border: 1px solid var(--line);
  padding: 1px 6px; border-radius: 5px; color: var(--accent-2);
}

/* ----------------------------------------------------------- project grid */
.projects { display: grid; gap: 22px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.projects .feature { grid-column: 1 / -1; }

.card {
  display: flex; flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.18s, transform 0.18s, box-shadow 0.18s;
}
.card:hover {
  border-color: var(--line-hi);
  transform: translateY(-3px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}
.card .shot {
  position: relative;
  display: block;
  background: #05070c;
  border-bottom: 1px solid var(--line);
  aspect-ratio: 16 / 10;
  overflow: hidden;
}
.card .shot img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.5s ease;
}
.card:hover .shot img { transform: scale(1.03); }
.card.feature .shot { aspect-ratio: 21 / 9; }
.card .body { padding: 20px 20px 22px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.card h3 { margin: 0; font-size: 1.22rem; letter-spacing: -0.01em; }
.card h3 a { color: var(--text); }
.card h3 a:hover { color: var(--accent-2); }
.card .kicker {
  font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--faint); margin: 0;
}
.card p.blurb { margin: 0; color: var(--dim); font-size: 0.96rem; }
.card .links { display: flex; gap: 10px; flex-wrap: wrap; margin-top: auto; padding-top: 6px; }

.badge-live {
  position: absolute; top: 12px; left: 12px;
  font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.12em;
  text-transform: uppercase;
  background: rgba(7, 12, 20, 0.82);
  border: 1px solid var(--line-hi);
  color: var(--good);
  padding: 4px 9px; border-radius: 999px;
  backdrop-filter: blur(4px);
}

/* ------------------------------------------------------------ case study */
.case-hero { padding: 56px 0 8px; }
.case-hero h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.08; letter-spacing: -0.025em; margin: 0 0 14px;
}
.case-hero .lede { font-size: 1.12rem; color: var(--dim); max-width: 62ch; margin: 0 0 24px; }
.backlink { font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); display: inline-block; margin-bottom: 22px; }
.backlink:hover { color: var(--accent); }

.shotframe {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: #05070c;
  margin: 30px 0 8px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}
.caption { font-size: 0.82rem; color: var(--faint); margin: 10px 0 0; }

.factgrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 30px 0 6px;
}
.fact { background: var(--panel); padding: 14px 16px; }
.fact dt {
  font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.13em;
  text-transform: uppercase; color: var(--faint); margin: 0 0 4px;
}
.fact dd { margin: 0; font-size: 0.95rem; color: var(--text); }

article.case h2 {
  font-size: 1.5rem; letter-spacing: -0.015em;
  margin: 46px 0 14px; padding-top: 8px;
}
article.case h3 { font-size: 1.08rem; margin: 30px 0 8px; }
article.case p { color: var(--dim); max-width: 68ch; margin: 0 0 16px; }
article.case strong { color: var(--text); font-weight: 600; }
article.case code {
  font-family: var(--mono); font-size: 0.86em;
  background: var(--panel); border: 1px solid var(--line);
  padding: 1px 6px; border-radius: 5px; color: var(--accent-2);
}
article.case ul, article.case ol { color: var(--dim); max-width: 68ch; padding-left: 22px; }
article.case li { margin-bottom: 10px; }
article.case li::marker { color: var(--faint); }

.notecard {
  border-left: 3px solid var(--accent);
  background: linear-gradient(90deg, rgba(77, 163, 255, 0.07), transparent 70%);
  padding: 14px 18px;
  border-radius: 0 8px 8px 0;
  margin: 24px 0;
}
.notecard p { margin: 0; }

pre {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px 18px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 0.82rem;
  line-height: 1.6;
  color: var(--dim);
}
pre b { color: var(--accent-2); font-weight: 600; }

.pager {
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  border-top: 1px solid var(--line);
  margin-top: 56px; padding-top: 24px;
  font-size: 0.92rem;
}

/* ---------------------------------------------------------------- contact */
.contact-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 4px; }

/* ----------------------------------------------------------------- footer */
footer.site {
  border-top: 1px solid var(--line);
  margin-top: 60px;
  padding: 26px 0 40px;
  color: var(--faint);
  font-size: 0.86rem;
}
footer.site .wrap { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; }
footer.site a { color: var(--dim); }
footer.site a:hover { color: var(--accent); }

/* --------------------------------------------------------------- narrower */
@media (max-width: 760px) {
  body { font-size: 16px; }
  .hero { padding: 56px 0 36px; }
  .projects { grid-template-columns: 1fr; }
  .card.feature .shot { aspect-ratio: 16 / 10; }
  .navlinks { gap: 16px; font-size: 0.86rem; }
  .navlinks a.hide-sm { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .card:hover { transform: none; }
  .card:hover .shot img { transform: none; }
}

/* ==========================================================================
   Timeline — two tracks, work above the spine and everything self-taught
   below it. Horizontal and scrollable on desktop, vertical on phones.
   ========================================================================== */

.rail-wrap {
  position: relative;
  margin: 0 -24px;                 /* bleed past .wrap padding */
  padding: 0 24px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}
.rail-wrap::-webkit-scrollbar { height: 8px; }
.rail-wrap::-webkit-scrollbar-track { background: transparent; }
.rail-wrap::-webkit-scrollbar-thumb { background: var(--line-hi); border-radius: 4px; }

.rail {
  position: relative;
  display: flex;
  align-items: stretch;
  gap: 0;
  padding: 6px 0 14px;
  width: max-content;
}
/* the spine itself */
.rail::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 50%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line-hi) 6%, var(--line-hi) 94%, transparent);
}

.moment {
  position: relative;
  display: grid;
  grid-template-rows: 1fr 44px 1fr;
  width: 268px;
  flex: 0 0 268px;
  padding: 0 9px;
}

.moment .node {
  grid-row: 2;
  align-self: center;
  justify-self: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  z-index: 2;
}
.moment .dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--line-hi);
}
.moment.is-work .dot { border-color: var(--accent); box-shadow: 0 0 10px rgba(77,163,255,0.5); }
.moment.is-self .dot { border-color: var(--good); box-shadow: 0 0 10px rgba(61,220,151,0.45); }
.moment.is-both .dot {
  width: 12px; height: 12px;
  background: var(--accent);
  border-color: var(--accent-2);
  box-shadow: 0 0 16px rgba(106,213,255,0.75);
}
.moment .year {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  color: var(--faint);
  white-space: nowrap;
  background: var(--bg);
  padding: 0 6px;
}

.moment .card-t, .moment .card-b {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 10px;
  padding: 11px 13px 12px;
  font-size: 0.84rem;
  line-height: 1.45;
  color: var(--dim);
}
.moment .card-t { grid-row: 1; align-self: end; margin-bottom: 10px; border-top: 2px solid var(--accent); }
.moment .card-b { grid-row: 3; align-self: start; margin-top: 10px; border-bottom: 2px solid var(--good); }
.moment h3 {
  margin: 0 0 4px;
  font-size: 0.92rem;
  color: var(--text);
  letter-spacing: -0.01em;
}
.moment .org {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--faint);
  display: block;
  margin-bottom: 5px;
}
.moment p { margin: 0; }

.rail-legend {
  display: flex; gap: 20px; flex-wrap: wrap;
  font-size: 0.78rem; color: var(--faint);
  margin: 2px 0 18px;
}
.rail-legend span { display: inline-flex; align-items: center; gap: 7px; }
.rail-legend i {
  width: 18px; height: 2px; border-radius: 2px; display: inline-block;
}
.rail-legend .w i { background: var(--accent); }
.rail-legend .s i { background: var(--good); }

.rail-hint {
  font-size: 0.76rem; color: var(--faint);
  margin: 10px 0 0;
  display: flex; align-items: center; gap: 8px;
}

/* ------------------------------------------------------------ about + photo */
.about-grid {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 30px;
  align-items: start;
}
.portrait {
  border-radius: 14px;
  border: 1px solid var(--line-hi);
  overflow: hidden;
  background: var(--panel);
}
.portrait img { width: 100%; display: block; }

/* --------------------------------------------------------- before and after */
.thenandnow {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin: 28px 0 6px;
}
.thenandnow figure { margin: 0; }
.thenandnow img {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #05070c;
}
.thenandnow figcaption {
  font-size: 0.78rem;
  color: var(--faint);
  margin-top: 8px;
}
.thenandnow .tag {
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--dim);
  display: block;
  margin-bottom: 3px;
}

/* ------------------------------------------------------------- pull quote */
.pullquote {
  border-left: 3px solid var(--good);
  padding: 6px 0 6px 20px;
  margin: 30px 0;
  font-size: 1.12rem;
  line-height: 1.5;
  color: var(--text);
}
.pullquote span {
  display: block;
  font-size: 0.82rem;
  color: var(--faint);
  margin-top: 8px;
}

/* ------------------------------------------------------------- try this box */
.tryit {
  border: 1px dashed var(--line-hi);
  border-radius: 10px;
  padding: 14px 16px;
  margin: 26px 0;
  background: rgba(19, 28, 43, 0.5);
}
.tryit h4 {
  margin: 0 0 6px;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--good);
}
.tryit p { margin: 0; color: var(--dim); font-size: 0.94rem; }

/* --------------------------------------------------------------- wip badge */
.badge-wip {
  position: absolute; top: 12px; left: 12px;
  font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.12em;
  text-transform: uppercase;
  background: rgba(7, 12, 20, 0.82);
  border: 1px solid var(--line-hi);
  color: #fbbf24;
  padding: 4px 9px; border-radius: 999px;
  backdrop-filter: blur(4px);
}

@media (max-width: 760px) {
  /* the rail becomes a vertical timeline */
  .rail-wrap { overflow-x: visible; margin: 0; padding: 0; }
  .rail { flex-direction: column; width: 100%; }
  .rail::before { left: 7px; right: auto; top: 0; bottom: 0; width: 1px; height: auto; background: var(--line); }
  .moment {
    grid-template-rows: auto auto auto;
    grid-template-columns: 1fr;
    width: 100%; flex: 1 1 auto;
    padding: 0 0 0 30px;
    margin-bottom: 18px;
  }
  .moment .node {
    grid-row: 1;
    flex-direction: row;
    justify-self: start;
    margin-left: -30px;
    gap: 9px;
  }
  .moment .year { background: transparent; padding: 0; }
  .moment .card-t { grid-row: 2; margin: 6px 0 0; }
  .moment .card-b { grid-row: 3; margin: 10px 0 0; }
  .about-grid { grid-template-columns: 1fr; gap: 20px; }
  .portrait { max-width: 170px; }
  .thenandnow { grid-template-columns: 1fr; }
}

/* three-up variant for the browser demos */
.projects.trio { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.projects.trio .card .body { padding: 16px 16px 18px; gap: 10px; }
.projects.trio .card h3 { font-size: 1.06rem; }
.projects.trio .card p.blurb { font-size: 0.9rem; }
.subhead {
  display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap;
  margin: 42px 0 6px;
}
.subhead h3 {
  margin: 0; font-size: 0.94rem; font-family: var(--mono); font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--dim);
}
.subhead .note { font-size: 0.84rem; color: var(--faint); }
@media (max-width: 980px) { .projects.trio { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .projects.trio { grid-template-columns: 1fr; } }
