/* ==========================================================================
   arunan.in — style.css
   Pure CSS, no framework. Single stylesheet for the whole site.

   Contents:
   1. Design tokens
   2. Base / reset
   3. Header & navigation
   4. Footer
   5. Homepage (hero, nav blocks, pull-quote)
   6. Inner pages (About, Connect)
   7. Time on Earth (chronology)
   8. Utilities & accessibility
   ========================================================================== */

/* 1. Design tokens
   ------------------------------------------------------------------ */
:root {
  --ink: #18212A;      /* primary dark — Ink Navy */
  --slate: #59636D;    /* secondary text — Slate Grey */
  --mist: #D9DEE1;     /* separators — Mist Grey */
  --cloud: #F7F8F7;    /* background — Cloud White */
  --teal: #557A78;     /* accent — Muted Teal */

  --max-width: 1220px;
  --reading-width: 720px;

  --font-identity: "Alkatra", "Georgia", serif;      /* wordmark only */
  --font-body: "Roboto", "Helvetica Neue", Arial, sans-serif;
  --font-editorial: "Georgia", "Times New Roman", serif; /* pull-quotes only */

  --space-section: clamp(48px, 9vw, 112px);
  --pad-side: clamp(20px, 4vw, 48px);
}

/* 2. Base / reset
   ------------------------------------------------------------------ */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

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

body {
  margin: 0;
  background: var(--cloud);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 {
  font-weight: 500;
  line-height: 1.2;
  margin: 0 0 0.6em;
}

p {
  margin: 0 0 1.2em;
  color: var(--slate);
}

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

a {
  color: var(--teal);
  text-decoration: underline;
  text-decoration-color: var(--mist);
  text-underline-offset: 3px;
}

a:hover {
  text-decoration-color: var(--teal);
}

a:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 3px;
  border-radius: 1px;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding-left: var(--pad-side);
  padding-right: var(--pad-side);
}

/* 3. Header & navigation
   ------------------------------------------------------------------ */
.site-header {
  border-bottom: 1px solid var(--mist);
  position: relative;
  z-index: 2;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  flex-wrap: wrap;
}

.wordmark {
  font-family: var(--font-identity);
  font-weight: 500;
  font-size: 26px;
  color: var(--ink);
  text-decoration: none;
  line-height: 1;
  padding: 12px 0;
}

.wordmark:hover {
  text-decoration: none;
  color: var(--ink);
}

.site-nav ul {
  list-style: none;
  display: flex;
  gap: clamp(20px, 3vw, 40px);
  margin: 0;
  padding: 0;
}

.site-nav a {
  color: var(--slate);
  text-decoration: none;
  font-size: 15px;
  padding: 14px 2px; /* comfortable tap target */
  display: inline-block;
}

.site-nav a:hover {
  color: var(--ink);
}

.site-nav a[aria-current="page"] {
  color: var(--teal);
  border-bottom: 1px solid var(--teal);
}

/* Mobile menu — native <details>/<summary> toggle, no JavaScript.
   The <details> element holds only the summary; the nav is its sibling,
   shown or hidden with the [open] sibling selector on small screens. */
.menu-toggle {
  display: none;
}

@media (max-width: 640px) {
  .site-header .container {
    min-height: 64px;
  }

  .menu-toggle {
    display: block;
  }

  .menu-toggle summary {
    list-style: none;
    cursor: pointer;
    padding: 14px 6px;
    color: var(--slate);
  }

  .menu-toggle summary::-webkit-details-marker {
    display: none;
  }

  .menu-toggle summary::after {
    content: "Menu";
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 13px;
  }

  .menu-toggle[open] summary::after {
    content: "Close";
  }

  .site-nav {
    display: none;
  }

  .menu-toggle[open] + .site-nav {
    display: block;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    background: var(--cloud);
    border-bottom: 1px solid var(--mist);
  }

  .menu-toggle[open] + .site-nav ul {
    flex-direction: column;
    gap: 0;
    padding: 8px var(--pad-side) 16px;
  }

  .menu-toggle[open] + .site-nav li + li {
    border-top: 1px solid var(--mist);
  }

  .menu-toggle[open] + .site-nav a {
    display: block;
    padding: 14px 0;
    font-size: 16px;
  }

  .menu-toggle[open] + .site-nav a[aria-current="page"] {
    border-bottom: none;
    color: var(--teal);
  }
}

/* 4. Footer
   ------------------------------------------------------------------ */
.site-footer {
  border-top: 1px solid var(--mist);
  margin-top: var(--space-section);
  padding: 40px 0 48px;
  font-size: 15px;
}

.footer-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.footer-identity .wordmark {
  font-size: 22px;
  padding: 0;
}

.footer-tagline {
  color: var(--slate);
  margin: 4px 0 0;
}

.footer-links {
  list-style: none;
  display: flex;
  gap: 12px;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}

.footer-links li + li::before {
  content: "|";
  color: var(--mist);
  margin-right: 12px;
}

.footer-links a,
.footer-mail {
  color: var(--slate);
  text-decoration: none;
}

.footer-links a:hover,
.footer-mail:hover {
  color: var(--teal);
}

.footer-meta {
  color: var(--slate);
  margin: 28px 0 0;
  font-size: 13px;
  font-weight: 300;
}

/* 5. Homepage
   ------------------------------------------------------------------ */
.hero {
  position: relative;
  overflow: hidden;
  padding-top: var(--space-section);
  padding-bottom: var(--space-section);
}

/* Decorative watercolour — purely visual, never above text */
.hero-art {
  position: absolute;
  left: -8%;
  top: 0;
  width: min(52vw, 640px);
  opacity: 0.9;
  pointer-events: none;
  z-index: 0;
  /* soften the asset's hard top and bottom edges so it fades in quietly */
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 90px, #000 calc(100% - 80px), transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 90px, #000 calc(100% - 80px), transparent 100%);
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 640px;
  margin-left: auto;
  margin-right: clamp(0px, 6vw, 96px);
}

.hero-title {
  font-family: var(--font-identity);
  font-weight: 500;
  font-size: clamp(52px, 8vw, 96px);
  line-height: 1.05;
  margin: 0 0 18px;
}

.hero-rule {
  border: 0;
  border-top: 1px solid var(--mist);
  width: 100%;
  max-width: 520px;
  margin: 0 0 22px;
}

.hero-tagline {
  color: var(--teal);
  font-size: clamp(24px, 3.2vw, 32px);
  font-weight: 500;
  margin: 0 0 32px;
}

.hero-stanza {
  color: var(--slate);
  margin-bottom: 1.4em;
}

/* Homepage section links */
.home-links {
  border-top: 1px solid var(--mist);
  padding-top: 56px;
  padding-bottom: 8px;
}

.home-links ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
}

.home-links li {
  padding: 4px 36px;
}

.home-links li:first-child {
  padding-left: 0;
}

.home-links li + li {
  border-left: 1px solid var(--mist);
}

.link-index {
  display: block;
  color: var(--teal);
  font-size: 14px;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}

.home-links h2 {
  font-size: 26px;
  font-weight: 500;
  margin: 0 0 6px;
}

.home-links h2 a {
  color: var(--ink);
  text-decoration: none;
}

.home-links h2 a:hover {
  color: var(--teal);
}

.home-links h2 a::after {
  content: "\2192"; /* → */
  color: var(--teal);
  font-weight: 400;
  margin-left: 12px;
  display: inline-block;
}

.home-links p {
  margin: 0;
  font-size: 15px;
}

@media (max-width: 768px) {
  .home-links ul {
    grid-template-columns: 1fr;
  }

  .home-links li {
    padding: 24px 0;
  }

  .home-links li + li {
    border-left: none;
    border-top: 1px solid var(--mist);
  }
}

/* Pull-quote */
.pull-quote {
  margin: var(--space-section) auto 0;
  max-width: 760px;
  text-align: center;
  padding-top: 56px;
  border-top: 1px solid var(--mist);
}

.pull-quote blockquote {
  margin: 0;
}

.pull-quote p {
  font-family: var(--font-editorial);
  font-style: italic;
  font-size: clamp(19px, 2.4vw, 24px);
  line-height: 1.6;
  color: var(--ink);
  margin: 0;
}

.pull-quote::after {
  content: "";
  display: block;
  width: 48px;
  border-top: 1px solid var(--teal);
  margin: 40px auto 0;
}

/* 6. Inner pages (About, Connect)
   ------------------------------------------------------------------ */
.page {
  padding-top: var(--space-section);
}

.page-header {
  max-width: var(--reading-width);
  margin: 0 auto;
}

.page-header .link-index {
  margin-bottom: 14px;
}

.page-title {
  font-size: clamp(34px, 5vw, 48px);
  margin-bottom: 0.4em;
}

.prose {
  max-width: var(--reading-width);
  margin: 0 auto;
}

.prose .lead {
  color: var(--ink);
  font-size: 19px;
}

.prose-divider {
  border: 0;
  border-top: 1px solid var(--mist);
  max-width: var(--reading-width);
  margin: 48px auto;
}

.editorial-note {
  font-family: var(--font-editorial);
  font-style: italic;
  color: var(--ink);
  font-size: 20px;
  line-height: 1.6;
}

/* Connect */
.connect-mail {
  font-size: clamp(24px, 3.4vw, 32px);
  font-weight: 400;
  display: inline-block;
  margin: 8px 0 16px;
  padding: 8px 0; /* tap target */
}

/* 7. Time on Earth — chronology
   ------------------------------------------------------------------ */
.chronology {
  max-width: 920px;
  margin: 64px auto 0;
}

.chronology ol {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
}

/* the thin vertical line */
.chronology ol::before {
  content: "";
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 172px;
  border-left: 1px solid var(--mist);
}

.entry {
  display: grid;
  grid-template-columns: 140px 64px 1fr;
  margin-bottom: 56px;
}

.entry:last-child {
  margin-bottom: 0;
}

.entry-year {
  grid-column: 1;
  text-align: right;
  color: var(--ink);
  font-weight: 500;
  font-size: 17px;
  line-height: 1.65;
  white-space: nowrap;
}

/* the dot on the line */
.entry-dot {
  grid-column: 2;
  position: relative;
}

.entry-dot::before {
  content: "";
  position: absolute;
  left: 32px;
  top: 9px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--teal);
  transform: translateX(-50%);
}

.entry-body {
  grid-column: 3;
}

.entry-body p {
  margin-bottom: 0.8em;
}

.entry-body p:last-child {
  margin-bottom: 0;
}

.entry-body img {
  margin-top: 16px;
}

.chronology-close {
  max-width: var(--reading-width);
  margin: 72px auto 0;
  text-align: center;
}

.chronology-close p {
  font-family: var(--font-editorial);
  font-style: italic;
  color: var(--ink);
  font-size: 19px;
}

@media (max-width: 640px) {
  .chronology ol::before {
    display: none; /* per brief: line optional on mobile */
  }

  .entry {
    grid-template-columns: 1fr;
    margin-bottom: 44px;
    border-top: 1px solid var(--mist);
    padding-top: 20px;
  }

  .entry-year {
    grid-column: 1;
    text-align: left;
    margin-bottom: 4px;
    color: var(--teal);
  }

  .entry-dot {
    display: none;
  }

  .entry-body {
    grid-column: 1;
  }
}

/* 8. Utilities & accessibility
   ------------------------------------------------------------------ */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--cloud);
  padding: 10px 16px;
  z-index: 10;
}

.skip-link:focus {
  left: 0;
}

/* Small screens: keep the hero art quiet and behind text */
@media (max-width: 900px) {
  .hero-art {
    width: 78vw;
    left: -22%;
    top: 0;
    opacity: 0.55;
  }

  .hero-content {
    margin-right: 0;
  }
}

@media (max-width: 380px) {
  body {
    font-size: 16px;
  }
}
