/* Mithran Selvaraj — minimalist editorial portfolio.
   Type: Newsreader (serif display) + Geist (sans body). Light theme,
   soft white gradient. One restrained accent (pine). */

:root {
  --bg-1: #ffffff;
  --bg-2: #eef0f3;
  --ink: #18191d;
  --ink-soft: #34363c;
  --muted: #6a6d74;
  --line: #e6e7ea;
  --accent: #177a53;
  --accent-deep: #0f5c3d;

  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --wrap: 42rem;
}

/* ---- fonts ---- */
@font-face { font-family: "Geist"; src: url("/fonts/geist-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Geist"; src: url("/fonts/geist-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Geist"; src: url("/fonts/geist-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Newsreader"; src: url("/fonts/newsreader-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Newsreader"; src: url("/fonts/newsreader-500.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Newsreader"; src: url("/fonts/newsreader-600.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Newsreader"; src: url("/fonts/newsreader-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }

/* ---- reset ---- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; }

body {
  min-height: 100dvh;
  font-family: var(--sans);
  font-size: clamp(1rem, 0.95rem + 0.3vw, 1.125rem);
  line-height: 1.65;
  color: var(--ink-soft);
  background-color: var(--bg-2);
  background-image: linear-gradient(180deg, #ffffff 0%, #f5f6f9 55%, #eceef2 100%);
  background-repeat: no-repeat;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: 1.5rem;
}

/* ---- type ---- */
h1, h2, h3 { font-family: var(--serif); font-weight: 500; color: var(--ink); line-height: 1.1; letter-spacing: -0.015em; text-wrap: balance; }
p { text-wrap: pretty; }
em { font-style: italic; }
strong { font-weight: 600; color: var(--ink); }

a { color: inherit; text-decoration: none; }

.eyebrow {
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---- header ---- */
.site-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding-block: 2rem 0;
}
.site-head .name { font-family: var(--serif); font-size: 1.15rem; font-weight: 500; color: var(--ink); letter-spacing: -0.01em; }
.site-nav { display: flex; gap: 1.25rem; font-size: 0.9rem; color: var(--muted); }
.site-nav a { position: relative; transition: color 0.18s ease; }
.site-nav a:hover { color: var(--ink); }

/* ---- hero ---- */
.hero { padding-block: clamp(3rem, 8vw, 5.5rem) clamp(1.75rem, 4vw, 2.75rem); }
.hero h1 {
  font-size: clamp(2.6rem, 6vw, 4.25rem);
  font-weight: 500;
  margin-top: 1.1rem;
  letter-spacing: -0.02em;
}
.hero .lede {
  margin-top: 1.5rem;
  max-width: 34rem;
  font-size: clamp(1.1rem, 1rem + 0.5vw, 1.3rem);
  color: var(--ink-soft);
}
.hero .social { margin-top: 2rem; display: flex; flex-wrap: wrap; gap: 1.4rem; font-size: 0.95rem; }
.hero .social a {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--muted);
  transition: color 0.18s ease;
}
.hero .social a:hover { color: var(--accent); }
.icn { width: 1.05em; height: 1.05em; flex: none; display: block; }

/* ---- sections ---- */
section { padding-block: clamp(1.9rem, 4.5vw, 3.25rem); }
.section-head { margin-bottom: 2rem; }
.section-head h2 { font-size: clamp(1.4rem, 1.1rem + 1vw, 1.85rem); }

/* work list */
.entries { display: flex; flex-direction: column; }
.entry { padding-block: 1.6rem; }
.entry + .entry { border-top: 1px solid var(--line); }
.entry .row { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.entry h3 { font-size: 1.4rem; font-weight: 500; transition: color 0.18s ease; }
.entry a.title:hover h3 { color: var(--accent); }
.entry .arrow { color: var(--muted); transition: transform 0.2s ease, color 0.2s ease; }
.entry a.title:hover .arrow { color: var(--accent); transform: translate(2px, -2px); }
.entry .meta { margin-top: 0.4rem; font-size: 0.85rem; color: var(--muted); }
.entry .desc { margin-top: 0.55rem; color: var(--ink-soft); max-width: 34rem; }
.badge {
  display: inline-block; font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 0.1rem 0.6rem;
  vertical-align: 0.15em;
}
.badge.running { color: var(--accent-deep); border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }

/* writing list */
.posts { display: flex; flex-direction: column; }
.post { display: flex; align-items: baseline; gap: 1.25rem; padding-block: 0.85rem; }
.post + .post { border-top: 1px solid var(--line); }
.post-link { display: flex; gap: 1.25rem; align-items: baseline; width: 100%; }
.post time { flex: none; width: 6.5rem; font-size: 0.85rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.post .t { font-family: var(--serif); font-size: 1.15rem; color: var(--ink); transition: color 0.18s ease; }
.post a:hover .t { color: var(--accent); }

/* prose (about) */
.prose p { margin-top: 1rem; max-width: 36rem; }
.prose p:first-child { margin-top: 0; }
.prose a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
.prose a:hover { color: var(--accent); }
.prose ul { margin-top: 1rem; padding-left: 1.1rem; }
.prose code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 0.9em; background: #f1f2f4; padding: 0.1em 0.35em; border-radius: 4px; }

/* ---- footer ---- */
.site-foot { border-top: 1px solid var(--line); margin-top: 2rem; padding-block: 2.5rem clamp(2.5rem, 6vw, 4rem); }
.site-foot .eyebrow { margin-bottom: 0.7rem; }
.site-foot .contact { font-family: var(--serif); font-size: clamp(1.3rem, 1.1rem + 1vw, 1.7rem); color: var(--ink); }
.site-foot .contact a { text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 5px; text-decoration-thickness: 1px; transition: text-decoration-color 0.18s ease; }
.site-foot .contact a:hover { text-decoration-color: var(--accent); }
.site-foot .row2 { margin-top: 1.5rem; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; font-size: 0.9rem; color: var(--muted); }
.site-foot .row2 .links { display: flex; flex-wrap: wrap; gap: 1.25rem; }
.site-foot .row2 a { display: inline-flex; align-items: center; gap: 0.4rem; transition: color 0.18s ease; }
.site-foot .row2 a:hover { color: var(--accent); }

/* ---- focus + selection ---- */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
::selection { background: color-mix(in srgb, var(--accent) 18%, transparent); }

/* ---- scroll reveal (only active once JS marks the doc) ---- */
.js .reveal { opacity: 0; transform: translateY(14px); }
.js .reveal.in { opacity: 1; transform: none; transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.16, 1, 0.3, 1); }
@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
}
