/* smshanto.com — a personal site written like a test report. */

@font-face {
  font-family: "Schibsted Grotesk";
  src: url("/fonts/schibsted-v2.woff2") format("woff2");
  font-weight: 400 900;
  font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("/fonts/newsreader-v2.woff2") format("woff2");
  font-weight: 400 600;
  font-display: swap;
}
@font-face {
  font-family: "Martian Mono";
  src: url("/fonts/martian-mono-v2.woff2") format("woff2");
  font-weight: 300 600;
  font-display: swap;
}

:root {
  --bg: #F2F4F7;
  --surface: #FFFFFF;
  --ink: #121A2B;
  --muted: #536074;
  --rule: #D8DDE6;
  --pass: #157A4B;
  --pend: #94570A;
  --link: #2246C4;
  --term: #121A2B;
  --term-ink: #DCE3EE;
  --term-dim: #8995A9;
  --term-pass: #5BD69A;
  --term-pend: #F0B54F;
  --focus: #2246C4;

  --display: "Schibsted Grotesk", "Helvetica Neue", Arial, sans-serif;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --mono: "Martian Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --wrap: 68rem;
  --gutter: 11rem;
  --radius: 14px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0D121C;
    --surface: #141B29;
    --ink: #E7EBF2;
    --muted: #9AA4B6;
    --rule: #263149;
    --pass: #4CC88C;
    --pend: #E9A947;
    --link: #93ABFF;
    --term: #070A11;
    --focus: #93ABFF;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0D121C;
  --surface: #141B29;
  --ink: #E7EBF2;
  --muted: #9AA4B6;
  --rule: #263149;
  --pass: #4CC88C;
  --pend: #E9A947;
  --link: #93ABFF;
  --term: #070A11;
  --focus: #93ABFF;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 5rem; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.1875rem;
  line-height: 1.6;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 { font-family: var(--display); margin: 0; line-height: 1.15; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: var(--link); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
strong { font-weight: 600; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--ink); color: var(--bg); }

.skip {
  position: absolute; left: 1rem; top: -4rem; z-index: 100;
  background: var(--ink); color: var(--bg); padding: 0.6rem 1rem; border-radius: 8px;
  font: 600 0.9rem var(--display);
}
.skip:focus { top: 1rem; }

/* ---------- header ---------- */
.top {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--rule);
}
.top-in {
  max-width: var(--wrap); margin: 0 auto; padding: 0.8rem 1.5rem;
  display: flex; align-items: center; gap: 1.5rem;
}
.mark {
  display: inline-flex; align-items: center; gap: 0.6rem;
  color: var(--ink); text-decoration: none;
  font: 700 1rem var(--display); letter-spacing: -0.01em;
}
.mark-glyph {
  display: grid; place-items: center; width: 1.9rem; height: 1.9rem;
  border-radius: 7px; background: var(--ink); color: var(--bg);
  font: 800 1rem var(--display);
}
.top-in > nav { margin-left: auto; }
.nav { display: flex; gap: 0.25rem; }
.nav a {
  display: block; padding: 0.4rem 0.7rem; border-radius: 8px;
  color: var(--muted); text-decoration: none;
  font: 500 0.92rem var(--display);
}
.nav a:hover { color: var(--ink); background: var(--surface); }
.nav a[aria-current="true"] { color: var(--ink); background: var(--surface); box-shadow: inset 0 0 0 1px var(--rule); }
.theme {
  display: grid; place-items: center; width: 2.4rem; height: 2.4rem; flex: none;
  border: 1px solid var(--rule); border-radius: 10px; background: var(--surface);
  color: var(--ink); cursor: pointer;
}
.theme:hover { border-color: var(--muted); }
.theme svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.theme .moon { display: none; }
:root[data-theme="dark"] .theme .sun { display: none; }
:root[data-theme="dark"] .theme .moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme .sun { display: none; }
  :root:not([data-theme="light"]) .theme .moon { display: block; }
}

/* ---------- hero ---------- */
main { max-width: var(--wrap); margin: 0 auto; padding: 0 1.5rem; }

.hero {
  padding: clamp(3.5rem, 9vw, 7rem) 0 clamp(3rem, 7vw, 5.5rem);
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  grid-template-areas: "kicker kicker" "title title" "lede run";
  column-gap: clamp(2rem, 5vw, 4rem); row-gap: 1.6rem; align-items: start;
}
.kicker { grid-area: kicker; margin: 0; font: 500 0.78rem/1.6 var(--mono); letter-spacing: 0.02em; color: var(--ink); }
.kicker span { font-weight: 400; color: var(--muted); }
.hero .tagline, .lost h1 {
  grid-area: title; margin: 0; font-family: var(--display);
  font-size: clamp(2.6rem, 7.4vw, 5.9rem);
  font-weight: 800; letter-spacing: -0.042em; line-height: 0.96;
  max-width: 14ch; text-wrap: balance;
}
.lede { grid-area: lede; font-size: clamp(1.15rem, 1.8vw, 1.35rem); line-height: 1.55; max-width: 34rem; color: var(--ink); padding-top: 0.4rem; }
.lede strong { font-weight: 600; }

/* the signature: a test run that summarises a person */
.run {
  grid-area: run; margin: 0;
  background: var(--term); color: var(--term-ink);
  border-radius: var(--radius); overflow: hidden;
  box-shadow: 0 1px 0 rgba(255,255,255,0.04) inset, 0 18px 40px -22px rgba(18, 26, 43, 0.55);
}
.run-bar {
  display: flex; align-items: center; gap: 6px;
  padding: 0.65rem 0.9rem; border-bottom: 1px solid rgba(255,255,255,0.07);
}
.run-bar i { width: 10px; height: 10px; border-radius: 50%; background: #2C3650; }
.run-bar span { margin-left: auto; font: 400 0.68rem var(--mono); color: var(--term-dim); }
.run-body {
  margin: 0; padding: 1rem 1.1rem 1.15rem;
  font: 400 0.76rem/1.95 var(--mono); white-space: normal; overflow-wrap: anywhere;
}
.run-body .l { display: block; padding-left: 1.5em; text-indent: -1.5em; }
.run-body .l b:first-child { display: inline-block; width: 1.5em; text-indent: 0; }
.run-body .sum b:first-child { width: auto; }
.run-body .l6 .pend { width: 1em; margin-right: 0.5em; text-align: center; }
.run-body code { font: inherit; }
.run-body b { font-weight: 500; }
.run-body .prompt { color: var(--term-dim); }
.run-body .ok { color: var(--term-pass); }
.run-body .pend { color: var(--term-pend); }
.run-body em { font-style: normal; color: var(--term-dim); }
.run-body .sum { margin-top: 0.5rem; padding: 0.5rem 0 0; text-indent: 0; border-top: 1px dashed rgba(255,255,255,0.14); color: var(--term-dim); }

@media (prefers-reduced-motion: no-preference) {
  .run-body .l { opacity: 0; animation: line-in 0.01s forwards; }
  .run-body .l1 { animation-delay: 0.25s; }
  .run-body .l2 { animation-delay: 0.65s; }
  .run-body .l3 { animation-delay: 0.85s; }
  .run-body .l4 { animation-delay: 1.05s; }
  .run-body .l5 { animation-delay: 1.25s; }
  .run-body .l6 { animation-delay: 1.45s; }
  .run-body .l7 { animation-delay: 1.85s; }
  .run-body .l6 .pend { display: inline-block; animation: spin 1.6s linear 1.45s infinite; }
}
@keyframes line-in { to { opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- sections as log rows ---------- */
.row {
  display: grid; grid-template-columns: var(--gutter) minmax(0, 1fr);
  column-gap: 2.5rem;
  padding: 3.5rem 0;
  border-top: 1px solid var(--rule);
}
.gutter h2 {
  font: 500 0.78rem var(--mono); letter-spacing: 0.02em; text-transform: lowercase;
  color: var(--ink); position: sticky; top: 5rem;
}
.gutter h2::before { content: "# "; color: var(--muted); }
.gutter-note { margin-top: 0.75rem; font: 400 0.7rem/1.7 var(--mono); color: var(--muted); max-width: 11rem; }
.body { max-width: 46rem; }

.prose p + p { margin-top: 1rem; }
.prose > p:first-child { font-size: 1.28rem; line-height: 1.5; }

.tags { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-top: 1.6rem; }
.tags li {
  font: 400 0.7rem var(--mono); color: var(--muted);
  border: 1px solid var(--rule); background: var(--surface);
  padding: 0.35rem 0.65rem; border-radius: 999px;
}

/* work */
.timeline li {
  display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: 1.25rem;
  padding: 1.15rem 0; border-bottom: 1px dashed var(--rule);
}
.timeline li:first-child { padding-top: 0; }
.when { font: 400 0.74rem/2 var(--mono); color: var(--muted); white-space: nowrap; }
.timeline h3 { font-size: 1.22rem; font-weight: 700; letter-spacing: -0.015em; }
.at { display: block; font: 500 0.95rem var(--display); color: var(--muted); letter-spacing: 0; margin-top: 0.15rem; }
.timeline p { margin-top: 0.45rem; color: var(--ink); font-size: 1.05rem; }

.sub { font: 500 0.78rem var(--mono); color: var(--muted); margin: 2.5rem 0 0.9rem; letter-spacing: 0.02em; }
.study li {
  display: flex; justify-content: space-between; gap: 1rem 2rem; flex-wrap: wrap;
  padding: 0.6rem 0; border-bottom: 1px dashed var(--rule); font-size: 1.02rem;
}
.study .at { display: inline; font-size: 0.9rem; margin: 0; }
.note { margin-top: 1.4rem; font: 400 0.7rem/1.7 var(--mono); color: var(--muted); }

/* projects */
.projects { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.proj {
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius);
  padding: 1.3rem 1.35rem 1.2rem; display: flex; flex-direction: column; gap: 0.6rem;
  transition: border-color 0.2s, transform 0.2s;
}
.proj:hover { border-color: var(--muted); }
.proj h3 { font-size: 1.32rem; font-weight: 750; letter-spacing: -0.02em; }
.proj h3 a { color: var(--ink); text-decoration: none; }
.proj h3 a span { color: var(--muted); font-weight: 500; font-size: 0.9em; }
.proj h3 a:hover { color: var(--link); }
.proj h3 a:hover span { color: var(--link); }
.proj > p:not(.status):not(.stack) { font-size: 1.02rem; line-height: 1.55; }
.stack { margin-top: auto; padding-top: 0.4rem; font: 400 0.66rem var(--mono); color: var(--muted); }

.status {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 0.45rem;
  font: 500 0.66rem var(--mono); letter-spacing: 0.02em; color: var(--muted);
}
.status::before { content: ""; width: 0.55rem; height: 0.55rem; border-radius: 50%; border: 1.5px solid currentColor; }
.s-live { color: var(--pass); }
.s-live::before { background: currentColor; }
.s-build { color: var(--pend); }
.s-build::before { border-style: dashed; }
.s-ready { color: var(--ink); }
.s-ready::before { background: currentColor; opacity: 0.35; }
.s-exp { color: var(--muted); }

/* youtube */
.yt-cta { display: flex; align-items: center; flex-wrap: wrap; gap: 0.6rem 1.2rem; margin: 1.5rem 0 1.75rem; }
.yt-cta .btn { text-decoration: none; display: inline-flex; gap: 0.4rem; }
.yt-meta { font: 400 0.7rem var(--mono); color: var(--muted); }
.vids { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.vid a { display: flex; flex-direction: column; gap: 0.45rem; color: var(--ink); text-decoration: none; }
.vid img {
  display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover;
  border-radius: 10px; border: 1px solid var(--rule); background: var(--surface);
  transition: transform 0.2s, border-color 0.2s;
}
.vid-tag { font: 400 0.64rem var(--mono); color: var(--muted); margin-top: 0.2rem; }
.vid-title { font: 600 0.98rem/1.3 var(--display); letter-spacing: -0.01em; }
.vid a:hover .vid-title { color: var(--link); text-decoration: underline; text-underline-offset: 0.18em; }
.vid a:hover img { border-color: var(--muted); }
@media (prefers-reduced-motion: no-preference) { .vid a:hover img { transform: translateY(-2px); } }

/* buttons */
.btn {
  font: 600 0.95rem var(--display); cursor: pointer; border-radius: 10px;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.btn { background: var(--ink); color: var(--bg); border: 1px solid var(--ink); padding: 0.75rem 1.2rem; }
.btn:hover { background: var(--link); border-color: var(--link); color: #fff; }
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.6rem; }
#mail-out:empty { display: none; }
#mail-out a { font: 600 1.1rem var(--display); margin-right: 0.5rem; }
.btn-social {
  display: inline-flex; align-items: center; gap: 0.55rem;
  padding: 0.72rem 1.1rem; border-radius: 10px;
  background: var(--surface); color: var(--ink); border: 1px solid var(--rule);
  font: 600 0.95rem var(--display); text-decoration: none;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.btn-social:hover { border-color: var(--muted); box-shadow: 0 6px 18px -12px rgba(18, 26, 43, 0.45); }
@media (prefers-reduced-motion: no-preference) { .btn-social:hover { transform: translateY(-1px); } }
.ico { flex: none; display: block; }
.ico-li { fill: #0A66C2; }
.ico-yt .yt-bg { fill: #FF0033; }
.ico-yt .yt-play { fill: #FFFFFF; }
.btn-yt { display: inline-flex; align-items: center; gap: 0.55rem; }

/* footer */
.foot {
  max-width: var(--wrap); margin: 2rem auto 0; padding: 1.75rem 1.5rem 2.5rem;
  border-top: 1px solid var(--rule);
  display: flex; justify-content: space-between; gap: 0.5rem 2rem; flex-wrap: wrap;
  font: 400 0.7rem var(--mono); color: var(--muted);
}
.foot a { color: var(--muted); }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .hero { grid-template-columns: minmax(0, 1fr); grid-template-areas: "kicker" "title" "lede" "run"; }
  .run { max-width: 34rem; }
  .row { grid-template-columns: minmax(0, 1fr); row-gap: 1.4rem; padding: 2.75rem 0; }
  .gutter h2 { position: static; }
  .gutter-note { max-width: none; }
}
@media (max-width: 760px) {
  .top-in { flex-wrap: wrap; row-gap: 0.4rem; padding-bottom: 0.45rem; }
  .theme { margin-left: auto; }
  .top-in > nav { order: 3; width: 100%; overflow-x: auto; scrollbar-width: none; margin: 0 0 0 -0.7rem; }
  nav::-webkit-scrollbar { display: none; }
  .nav { width: max-content; }
  .nav a { padding: 0.35rem 0.7rem; font-size: 0.88rem; white-space: nowrap; }
  html { scroll-padding-top: 7rem; }
  .projects { grid-template-columns: minmax(0, 1fr); }
  .vids { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  body { font-size: 1.1rem; }
  main, .top-in, .foot { padding-left: 1rem; padding-right: 1rem; }
  .timeline li { grid-template-columns: minmax(0, 1fr); gap: 0.15rem; }
  .run-body { font-size: 0.7rem; }
}

@media print {
  .top, .theme, .actions, .skip { display: none !important; }
  body { background: #fff; color: #000; }
  .row { break-inside: avoid; }
}

/* 404 */
.lost { grid-template-areas: "kicker kicker" "title title" "run lede"; min-height: 70vh; align-content: center; }
.run-body .fail { color: #FF8A80; }
@media (max-width: 960px) { .lost { grid-template-areas: "kicker" "title" "run" "lede"; } }
:root[data-theme="dark"] .ico-li { fill: #70B5F9; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .ico-li { fill: #70B5F9; } }
