/* ============================================================
   shakilahmad.com — "Navigating by Stars"
   Hand-built. No frameworks. No trackers.
   ============================================================ */

@font-face {
  font-family: "Instrument Serif";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/instrument-serif.woff2") format("woff2");
}
@font-face {
  font-family: "Instrument Serif";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/instrument-serif-italic.woff2") format("woff2");
}

:root {
  --night:      #070b18;
  --night-soft: #0c1226;
  --ink:        #ece7da;
  --muted:      #9aa0b4;
  --faint:      #6b7188;
  --gold:       #d9b36a;
  --gold-bright:#f2d795;
  --gold-dim:   rgba(217, 179, 106, 0.28);
  --hairline:   rgba(236, 231, 218, 0.12);
  --serif: "Instrument Serif", Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--night);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: var(--gold); color: var(--night); }

/* The sky sits behind everything */
#sky {
  position: fixed;
  inset: 0;
  z-index: -2;
  display: block;
}

/* A soft nebula glow, pure CSS — costs nothing */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 50% at 70% -10%, rgba(58, 66, 118, 0.35), transparent 60%),
    radial-gradient(ellipse 60% 40% at 15% 110%, rgba(90, 62, 38, 0.18), transparent 60%);
}

.wrap {
  max-width: 920px;
  margin: 0 auto;
  padding: 0 24px;
}

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

/* ---------- Hero / the business card ---------- */

.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  position: relative;
  padding: 24px;
}

.eyebrow {
  font-size: 12px;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 28px;
}
.eyebrow::before, .eyebrow::after { content: "✦"; opacity: 0.7; }
.eyebrow::before { margin-right: 1.2em; }
.eyebrow::after  { margin-left: 1.2em; }

h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(3.4rem, 12vw, 7.6rem);
  line-height: 0.98;
  letter-spacing: 0.01em;
  background: linear-gradient(180deg, #fdf6e3 0%, var(--ink) 55%, #b9a87c 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.tagline {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.25rem, 3.4vw, 1.75rem);
  color: var(--gold);
  margin-top: 26px;
  max-width: 26em;
  line-height: 1.4;
}

.lede {
  color: var(--muted);
  max-width: 36em;
  margin-top: 22px;
  font-size: 1.02rem;
}

.hero-rule {
  width: 0;
  height: 1px;
  margin: 34px auto 0;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  animation: rule-grow 1.6s 1.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
@keyframes rule-grow { to { width: min(340px, 70vw); } }

.cta-row {
  display: flex;
  gap: 16px;
  margin-top: 38px;
  flex-wrap: wrap;
  justify-content: center;
}

.btn {
  display: inline-block;
  padding: 12px 30px;
  border: 1px solid var(--gold-dim);
  border-radius: 999px;
  color: var(--gold);
  font-size: 13px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  transition: border-color 0.35s, box-shadow 0.35s, color 0.35s, background 0.35s;
}
.btn:hover {
  color: var(--night);
  background: var(--gold);
  border-color: var(--gold);
  box-shadow: 0 0 34px rgba(217, 179, 106, 0.35);
}

.scroll-hint {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--faint);
  font-size: 11px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  animation: drift-down 2.6s ease-in-out infinite;
}
@keyframes drift-down {
  0%, 100% { transform: translate(-50%, 0);   opacity: 0.55; }
  50%      { transform: translate(-50%, 8px); opacity: 1; }
}

/* Entrance choreography */
.rise {
  opacity: 0;
  transform: translateY(26px);
  animation: rise 1.1s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.rise-1 { animation-delay: 0.45s; }
.rise-2 { animation-delay: 0.75s; }
.rise-3 { animation-delay: 1.05s; }
.rise-4 { animation-delay: 1.35s; }
.rise-5 { animation-delay: 1.85s; }
@keyframes rise { to { opacity: 1; transform: none; } }

/* ---------- Sections ---------- */

section { padding: 96px 0; }

.reveal {
  opacity: 0;
  transform: translateY(34px);
  transition: opacity 0.9s ease, transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal.in { opacity: 1; transform: none; }

h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2rem, 5.5vw, 2.9rem);
  line-height: 1.15;
  margin-bottom: 14px;
}
h2 em { font-style: italic; color: var(--gold); }

.section-kicker {
  font-size: 11px;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 18px;
}
.section-kicker::before { content: "✦ "; color: var(--gold); }

.prose p { color: var(--muted); max-width: 44em; }
.prose p + p { margin-top: 1.2em; }
.prose strong { color: var(--ink); font-weight: 600; }
.prose em { color: var(--gold); }

/* ---------- The constellation of work ---------- */

.constellation-note {
  color: var(--faint);
  font-size: 0.92rem;
  font-style: italic;
  margin-bottom: 8px;
}

.constellation {
  width: 100%;
  height: auto;
  margin-top: 10px;
  overflow: visible;
}

.constellation .lines line {
  stroke: rgba(217, 179, 106, 0.18);
  stroke-width: 1;
}

.constellation a { outline: none; }

.constellation .node circle.core {
  fill: var(--gold);
  transition: r 0.3s, fill 0.3s;
}
.constellation .node circle.halo {
  fill: none;
  stroke: rgba(217, 179, 106, 0.25);
  stroke-width: 1;
  transition: stroke 0.3s, r 0.3s;
}
.constellation .node text {
  font-family: var(--sans);
  font-size: 15px;
  fill: var(--ink);
  transition: fill 0.3s;
}
.constellation .node text .role {
  font-size: 11.5px;
  fill: var(--faint);
  letter-spacing: 0.04em;
}
.constellation a:hover .node circle.core,
.constellation a:focus .node circle.core { fill: var(--gold-bright); }
.constellation a:hover .node circle.halo,
.constellation a:focus .node circle.halo { stroke: var(--gold-bright); }
.constellation a:hover .node text,
.constellation a:focus .node text { fill: var(--gold-bright); }

/* Twinkle for the constellation stars */
.constellation .node circle.core { animation: star-breathe 4s ease-in-out infinite; }
@keyframes star-breathe {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.55; }
}

/* Mobile fallback list */
.star-list { display: none; list-style: none; margin-top: 28px; }
.star-list li { border-bottom: 1px solid var(--hairline); }
.star-list a {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 16px 4px;
  color: var(--ink);
}
.star-list a::before { content: "✦"; color: var(--gold); margin-right: 10px; }
.star-list .role { color: var(--faint); font-size: 0.85rem; text-align: right; }
.star-list a:hover { color: var(--gold-bright); }

@media (max-width: 680px) {
  .constellation, .constellation-note { display: none; }
  .star-list { display: block; }
}

/* ---------- Writing ---------- */

.post-list { list-style: none; margin-top: 30px; }
.post-list li { border-bottom: 1px solid var(--hairline); }
.post-list a {
  display: block;
  padding: 22px 4px;
  color: var(--ink);
}
.post-list a:hover .post-title { color: var(--gold-bright); }
.post-date {
  font-size: 11px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--faint);
}
.post-title {
  font-family: var(--serif);
  font-size: 1.7rem;
  line-height: 1.25;
  margin-top: 4px;
  transition: color 0.3s;
}
.post-excerpt { color: var(--muted); font-size: 0.95rem; margin-top: 6px; max-width: 44em; }

/* ---------- Article pages ---------- */

.article {
  max-width: 680px;
  margin: 0 auto;
  padding: 140px 24px 60px;
}
.article-back {
  font-size: 12px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--faint);
}
.article-back:hover { color: var(--gold); }
.article h1 {
  font-size: clamp(2.4rem, 7vw, 3.8rem);
  margin-top: 22px;
  line-height: 1.08;
}
.article .post-date { margin-top: 16px; display: block; }
.article-body { margin-top: 44px; }
.article-body p { color: var(--muted); }
.article-body p + p { margin-top: 1.35em; }
.article-body strong { color: var(--ink); }
.article-body em { color: var(--gold); }
.article-body .drop::first-letter {
  font-family: var(--serif);
  font-size: 3.4em;
  float: left;
  line-height: 0.85;
  padding-right: 10px;
  color: var(--gold);
}
.article-rule {
  width: 90px;
  height: 1px;
  margin: 44px 0;
  background: linear-gradient(90deg, var(--gold), transparent);
}

/* ---------- Footer ---------- */

footer {
  border-top: 1px solid var(--hairline);
  padding: 56px 0 72px;
  text-align: center;
}
.footer-hello {
  font-family: var(--serif);
  font-size: clamp(1.8rem, 5vw, 2.6rem);
}
.footer-hello a { color: var(--ink); border-bottom: 1px solid var(--gold-dim); }
.footer-hello a:hover { color: var(--gold-bright); border-color: var(--gold-bright); }
.footer-note {
  color: var(--faint);
  font-size: 0.85rem;
  margin-top: 26px;
  line-height: 2;
}
.footer-note em { color: var(--muted); }

/* ---------- Accessibility & performance ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .rise, .hero-rule { animation: none; opacity: 1; transform: none; width: min(340px, 70vw); }
  .reveal { opacity: 1; transform: none; transition: none; }
  .scroll-hint { animation: none; }
  .constellation .node circle.core { animation: none; }
}
