/* ============================================================
   neekaan.com — Lantern Light (with dark toggle)
   Shared stylesheet for all pages.
   ============================================================ */

/* ---- Fonts ---- */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;1,400;1,500&family=Inter:wght@400;500&family=JetBrains+Mono:wght@400;500&display=swap');

/* ---- Tokens (light is default; dark overrides) ---- */
:root {
  --paper: #f7f1e6;
  --ink: #2a1f15;
  --ink-soft: rgba(42, 31, 21, 0.78);
  --ink-mute: rgba(42, 31, 21, 0.55);
  --ink-faint: rgba(42, 31, 21, 0.16);
  --amber: #cba14a;             /* the flame / point of light */
  --amber-deep: #a07a2c;        /* accent text, hover, links */
  --halo: rgba(204, 158, 80, 0.20);
  --halo-end: rgba(204, 158, 80, 0.06);
  --card: rgba(255, 250, 240, 0.7);
  --card-border: rgba(42, 31, 21, 0.10);
  --quote-wash-start: rgba(203, 161, 74, 0.10);
  --quote-border: rgba(160, 122, 44, 0.28);
  --shadow: 0 20px 50px rgba(140, 100, 40, 0.16);

  --serif: "Cormorant Garamond", "EB Garamond", Georgia, serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, monospace;
}

[data-theme="dark"] {
  --paper: #1a1614;
  --ink: #f3ead8;
  --ink-soft: rgba(243, 234, 216, 0.92);
  --ink-mute: rgba(243, 234, 216, 0.5);
  --ink-faint: rgba(243, 234, 216, 0.12);
  --amber: #f6d28a;
  --amber-deep: #e8b878;
  --halo: rgba(255, 200, 130, 0.22);
  --halo-end: rgba(255, 180, 100, 0.08);
  --card: rgba(243, 234, 216, 0.03);
  --card-border: rgba(243, 234, 216, 0.08);
  --quote-wash-start: rgba(232, 184, 120, 0.08);
  --quote-border: rgba(232, 184, 120, 0.20);
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

/* If no manual override, follow system preference */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #1a1614;
    --ink: #f3ead8;
    --ink-soft: rgba(243, 234, 216, 0.92);
    --ink-mute: rgba(243, 234, 216, 0.5);
    --ink-faint: rgba(243, 234, 216, 0.12);
    --amber: #f6d28a;
    --amber-deep: #e8b878;
    --halo: rgba(255, 200, 130, 0.22);
    --halo-end: rgba(255, 180, 100, 0.08);
    --card: rgba(243, 234, 216, 0.03);
    --card-border: rgba(243, 234, 216, 0.08);
    --quote-wash-start: rgba(232, 184, 120, 0.08);
    --quote-border: rgba(232, 184, 120, 0.20);
    --shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  }
}

/* ---- Reset / base ---- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
:root { background: var(--paper); }
body.lantern {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background 0.3s ease, color 0.3s ease;
}
a { color: inherit; }
img { max-width: 100%; height: auto; display: block; }

/* ---- Halo (radial glow at top) ---- */
.halo {
  position: fixed; inset: 0;
  pointer-events: none; z-index: 0;
  background: radial-gradient(ellipse 70% 50% at 50% 0%,
    var(--halo) 0%, var(--halo-end) 30%, transparent 65%);
}

/* ---- Layout ---- */
.page {
  position: relative;
  z-index: 1;
  max-width: 920px;
  margin: 0 auto;
  padding: 32px 48px 64px;
}

/* ---- Nav ---- */
.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.nav a { color: inherit; text-decoration: none; transition: color 0.2s; }
.nav a:hover { color: var(--amber-deep); }
.nav .current { color: var(--amber-deep); }
.nav .center { display: flex; align-items: center; gap: 16px; }

/* Theme toggle */
.theme-toggle {
  background: none;
  border: 1px solid var(--ink-faint);
  border-radius: 999px;
  width: 32px; height: 32px;
  cursor: pointer;
  color: var(--ink-mute);
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.theme-toggle:hover {
  color: var(--amber-deep);
  border-color: var(--amber-deep);
}
.theme-toggle svg { width: 14px; height: 14px; }
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
}

/* ---- Hero (home page) ---- */
.hero {
  text-align: center;
  margin-bottom: 80px;
  padding-top: 48px;
}
.hero .dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow:
    0 0 24px 6px var(--halo),
    0 0 60px 16px var(--halo-end);
  margin: 0 auto 40px;
  animation: flicker 4s ease-in-out infinite;
}
@keyframes flicker {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.92; transform: scale(0.97); }
}
.hero h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(48px, 8vw, 88px);
  line-height: 1.0;
  letter-spacing: -0.015em;
  margin: 0 0 28px;
  color: var(--ink);
}
.hero .tagline {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(18px, 2.4vw, 22px);
  line-height: 1.55;
  color: var(--ink-soft);
  margin: 0 auto;
  max-width: 720px;
  text-wrap: balance;
}

/* ---- Page header (subpages) ---- */
.page-header {
  text-align: center;
  margin: 32px 0 48px;
  padding-top: 32px;
}
.page-header h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(44px, 6vw, 72px);
  line-height: 1.0;
  letter-spacing: -0.015em;
  margin: 0;
  color: var(--ink);
}

/* ---- Index list (home page) ---- */
.index-list {
  max-width: 540px;
  margin: 0 auto;
}
.index-item {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: 16px;
  padding: 20px 0;
  border-bottom: 1px solid var(--ink-faint);
  text-decoration: none;
  color: inherit;
  transition: color 0.2s, padding 0.2s;
}
.index-item:last-child { border-bottom: none; }
.index-item:hover {
  color: var(--amber-deep);
  padding-left: 8px;
}
.index-item .name {
  font-family: var(--serif);
  font-size: 28px;
  letter-spacing: -0.01em;
}
.index-item .desc {
  font-size: 13px;
  color: var(--ink-mute);
  margin-top: 2px;
}
.index-item .arrow {
  font-family: var(--serif);
  font-size: 22px;
  color: var(--ink-mute);
}

/* ---- Prose ---- */
.prose {
  font-family: var(--serif);
  font-size: clamp(17px, 1.7vw, 19px);
  line-height: 1.75;
  color: var(--ink-soft);
  max-width: 640px;
  margin: 0 auto;
}
.prose p { margin: 0 0 1.2em; }
.prose p:last-child { margin-bottom: 0; }
.prose .lead {
  font-size: clamp(19px, 2.2vw, 22px);
  font-style: italic;
  color: var(--amber-deep);
  margin-bottom: 1.4em;
}
.prose a {
  color: var(--amber-deep);
  font-weight: 500;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}
.prose a:hover { border-bottom-color: var(--amber-deep); }

/* ---- Headshot ---- */
.headshot {
  width: 220px;
  aspect-ratio: 4 / 5;
  margin: 0 auto 56px;
  background-image: url('assets/headshot.jpeg');
  background-size: cover;
  background-position: center 20%;
  border-radius: 4px;
  box-shadow: var(--shadow), 0 0 0 1px var(--card-border);
}
[data-theme="dark"] .headshot { filter: sepia(0.18) brightness(0.95); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .headshot { filter: sepia(0.18) brightness(0.95); }
}

/* ---- Link list (Digital, Writing, Notes) ---- */
.link-list {
  max-width: 720px;
  margin: 0 auto;
}
.link-item {
  display: block;
  padding: 24px 0;
  border-top: 1px solid var(--ink-faint);
  text-decoration: none;
  color: inherit;
  transition: padding 0.2s, color 0.2s;
}
.link-list .link-item:last-child { border-bottom: 1px solid var(--ink-faint); }
.link-item:hover { padding-left: 8px; color: var(--amber-deep); }
.link-item .title {
  font-family: var(--serif);
  font-size: clamp(22px, 2.4vw, 26px);
  line-height: 1.25;
  margin: 0 0 6px;
  color: var(--ink);
  transition: color 0.2s;
}
.link-item:hover .title { color: var(--amber-deep); }
.link-item .subtitle {
  display: block;
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(15px, 1.5vw, 18px);
  line-height: 1.45;
  color: var(--ink-mute);
  margin: 4px 0 0;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}
.link-item .desc {
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-mute);
  margin: 0;
  max-width: 600px;
}
.link-item .meta {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--amber-deep);
  margin-bottom: 8px;
}

/* ---- Quote (consulting hero) ---- */
.hero-quote {
  max-width: 720px;
  margin: 0 auto 72px;
  padding: 48px 32px;
  text-align: center;
  background: linear-gradient(180deg, var(--quote-wash-start) 0%, transparent 100%);
  border: 1px solid var(--quote-border);
  border-radius: 4px;
}
.hero-quote blockquote {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(18px, 2.2vw, 22px);
  line-height: 1.5;
  color: var(--ink);
  margin: 0;
}
.hero-quote cite {
  display: block;
  margin-top: 24px;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--amber-deep);
  font-style: normal;
}

/* ---- Testimonial cards ---- */
.testimonials {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px 40px;
}
.testimonial {
  padding: 24px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 4px;
}
.testimonial p {
  font-family: var(--serif);
  font-size: 15.5px;
  line-height: 1.65;
  font-style: italic;
  color: var(--ink-soft);
  margin: 0 0 16px;
}
.testimonial .who {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--amber-deep);
}
.testimonial .who .role { color: var(--ink-mute); }

/* ---- Light page ---- */
.light-projects { max-width: 760px; margin: 40px auto 0; }
.light-project {
  padding: 56px 0 48px;
  border-bottom: 1px solid var(--ink-faint);
}
.light-project:first-child { border-top: 1px solid var(--ink-faint); }
.light-project-grid {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 24px;
  align-items: start;
}
.light-project-mark { padding-top: 8px; }
.light-project-num {
  font-family: var(--serif);
  font-style: italic;
  font-size: 32px;
  color: var(--amber-deep);
  margin-top: 14px;
  letter-spacing: 0.04em;
}
.light-project-kind {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--amber-deep);
  margin-bottom: 14px;
}
.light-project h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(28px, 3.6vw, 40px);
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin: 0 0 8px;
  color: var(--ink);
}
.light-project .project-subtitle {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(18px, 2.2vw, 22px);
  line-height: 1.3;
  color: var(--ink-mute);
  margin: 0 0 24px;
}
.light-project p {
  font-family: var(--serif);
  font-size: clamp(16px, 1.7vw, 18px);
  line-height: 1.75;
  color: var(--ink-soft);
  margin: 0;
}

/* Candle SVG color wiring */
.candle .flame { fill: var(--amber); }
.candle .flame-inner { fill: #fff5d8; opacity: 0.7; }
.candle .wick { stroke: var(--ink); }
.candle .body { fill: var(--card); stroke: var(--amber-deep); stroke-width: 0.6; }
.candle .base { fill: var(--amber-deep); opacity: 0.5; }
[data-theme="dark"] .candle .flame-inner { fill: #fffbe8; opacity: 0.85; }
[data-theme="dark"] .candle .body { fill: rgba(243, 234, 216, 0.1); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .candle .flame-inner { fill: #fffbe8; opacity: 0.85; }
  :root:not([data-theme="light"]) .candle .body { fill: rgba(243, 234, 216, 0.1); }
}

/* ---- CV page ---- */
.cv-card {
  max-width: 560px;
  margin: 0 auto;
  text-align: center;
  padding: 40px 32px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 4px;
}
.cv-meta {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-top: 24px;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  background: var(--amber);
  color: var(--paper);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-decoration: none;
  border-radius: 999px;
  transition: transform 0.15s, box-shadow 0.2s, background 0.2s;
}
.btn:hover {
  transform: translateY(-1px);
  background: var(--amber-deep);
  box-shadow: 0 8px 24px var(--halo);
}
[data-theme="dark"] .btn { color: #1a1614; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .btn { color: #1a1614; }
}

/* ---- Contact ---- */
.contact-block {
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
}

/* ---- Footer ---- */
.back-home {
  margin-top: 80px;
  text-align: center;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.back-home a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
  transition: color 0.2s, border-color 0.2s;
}
.back-home a:hover {
  color: var(--amber-deep);
  border-bottom-color: var(--amber-deep);
}
.back-home + .footer { margin-top: 32px; }

.footer {
  margin-top: 96px;
  padding-top: 24px;
  border-top: 1px solid var(--ink-faint);
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

/* ===========================================================
   Responsive
   =========================================================== */
@media (max-width: 720px) {
  .page { padding: 24px 24px 48px; }
  .nav { font-size: 11px; letter-spacing: 0.14em; }
  .nav .home-link { display: none; } /* keep current page name + back */
  .hero { margin-bottom: 56px; padding-top: 24px; }
  .hero h1 { font-size: 52px; }
  .index-item { padding: 18px 0; }
  .index-item .name { font-size: 24px; }
  .index-item .desc { font-size: 12px; }
  .testimonials { grid-template-columns: 1fr; gap: 20px; }
  .light-project-grid { grid-template-columns: 56px 1fr; gap: 16px; }
  .light-project { padding: 40px 0 32px; }
  .light-project-num { font-size: 24px; }
  .hero-quote { padding: 32px 20px; }
  .headshot { width: 180px; }
  .footer { margin-top: 64px; }
}

@media (max-width: 480px) {
  .nav { gap: 8px; flex-wrap: wrap; justify-content: center; }
  .nav .center { order: -1; width: 100%; justify-content: center; padding-bottom: 8px; }
  .light-project-grid { grid-template-columns: 1fr; gap: 12px; }
  .light-project-mark { display: flex; gap: 16px; align-items: center; padding-top: 0; }
  .light-project-num { margin-top: 0; }
}

/* No-JS: hide toggle button */
.no-js .theme-toggle { display: none; }
