/* ============================================================
   rishablodha.com — design system + mobile-first styles
   ============================================================ */
:root {
  /* tokens */
  --paper:      #FDFCF9;
  --ink:        #1B1814;
  --soft:       #4e493d;   /* AA body-muted on cream */
  --muted:      #7A7266;   /* labels, small text (AA for 14px+) */
  --faint:      #A29A8B;   /* decorative only, never text */
  --accent:     #9A4A2D;   /* brand terracotta */
  --accent-ink: #7E3A21;   /* accent used AS text/links (AA) */
  --accent-soft:#E8D4C8;   /* accent tint for chips/borders */
  --line:       #E7E0D4;   /* hairline rules */
  --dot:        #E2DACC;
  --grid:       22px;

  --serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --sans:  'Inter', -apple-system, 'Segoe UI', Roboto, sans-serif;

  --max:   820px;
  --radius: 10px;
  --radius-sm: 6px;

  /* fluid spacing scale (mobile-first) */
  --space-1:  clamp(0.5rem, 1vw, 0.75rem);
  --space-2:  clamp(0.75rem, 1.6vw, 1.25rem);
  --space-3:  clamp(1.25rem, 3vw, 2.25rem);
  --space-4:  clamp(2rem, 6vw, 4.5rem);
  --space-5:  clamp(3rem, 9vw, 6.5rem);

  --gutter: clamp(1.1rem, 4.5vw, 2rem);
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  background-color: var(--paper);
  background-image: radial-gradient(circle, var(--dot) 1.1px, transparent 1.3px);
  background-size: var(--grid) var(--grid);
  background-position: calc(var(--grid)/2) calc(var(--grid)/2);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body::before {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(253,252,249,.5), rgba(253,252,249,.12) 45%, rgba(253,252,249,.5));
}

a { color: inherit; text-decoration: none; }
a:focus-visible, input:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--radius-sm);
}
::selection { background: var(--accent); color: #fff; }

.wrap { position: relative; z-index: 1; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
section[id], div[id] { scroll-margin-top: 84px; }

/* top accent tape */
.tape { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 60;
  background: linear-gradient(90deg, var(--accent) 0 20%, transparent 20% 100%); }

/* ---------- header ---------- */
header {
  position: sticky; top: 3px; z-index: 50;
  background: rgba(253,252,249,.9); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
header .inner {
  max-width: var(--max); margin: 0 auto;
  padding: 1rem var(--gutter);
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.brand { font-family: var(--serif); font-weight: 500; font-size: 1.25rem; letter-spacing: -.01em; }
.brand i { font-style: italic; color: var(--accent); }
nav { display: flex; gap: 1.4rem; font-size: .875rem; color: var(--soft); align-items: center; }
nav a { padding: .35rem 0; border-bottom: 1px solid transparent; transition: color .15s, border-color .15s; }
nav a:hover { color: var(--accent-ink); border-color: var(--accent-soft); }
.contact {
  font-size: .8125rem; font-weight: 500; color: var(--soft);
  border: 1px solid var(--line); padding: .45rem .9rem; border-radius: var(--radius-sm);
  transition: color .15s, border-color .15s; white-space: nowrap;
}
.contact:hover { color: var(--ink); border-color: var(--accent); }
.contact:active { transform: translateY(1px); }

/* ---------- hero ---------- */
.hero { padding: var(--space-4) 0 var(--space-3); border-bottom: 1px solid var(--line); }
.hero .kicker {
  font-size: .72rem; letter-spacing: .22em; text-transform: uppercase;
  color: var(--accent-ink); font-weight: 600;
  display: flex; align-items: center; gap: .8rem;
}
.hero .kicker::before { content: ""; width: 1.5rem; height: 1.5px; background: var(--accent); }
h1 {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(2.35rem, 8.5vw, 3.75rem); /* fluid: ~38px @360 -> 60px desktop */
  line-height: 1.1; letter-spacing: -.02em;
  max-width: 18ch; margin-top: var(--space-2); text-wrap: balance; font-optical-sizing: auto;
}
h1 em { font-style: italic; color: var(--accent); }
.hero .lede { font-size: clamp(1.05rem, 2.6vw, 1.15rem); line-height: 1.75; color: var(--soft); max-width: 54ch; margin-top: var(--space-2); }
.hero .lede a { color: var(--accent-ink); border-bottom: 1px solid var(--accent); padding-bottom: 1px; transition: color .15s, border-color .15s; }
.hero .lede a:hover { color: var(--ink); border-color: var(--ink); }
.hero .meta {
  display: flex; flex-wrap: wrap; gap: .5rem 1.6rem; margin-top: var(--space-3);
  font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
}

/* ---------- sections ---------- */
.section { padding: var(--space-4) 0; border-bottom: 1px solid var(--line); }
.sec-h { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: var(--space-3); }
.sec-h h2 { font-family: var(--serif); font-weight: 500; font-size: clamp(1.55rem, 4vw, 1.9rem); letter-spacing: -.01em; }
.sec-h .sub { font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }

/* featured essay card */
.featured {
  background: rgba(255,255,255,.72);
  border: 1px solid var(--line); border-left: 3px solid var(--accent);
  padding: var(--space-3); border-radius: var(--radius);
  display: block; transition: border-color .15s, transform .15s ease, box-shadow .2s ease;
}
.featured:hover { border-left-color: var(--accent-ink); transform: translateY(-3px); box-shadow: 0 16px 36px -20px rgba(27,24,20,.25); }
.featured:active { transform: translateY(-1px); }
.featured .tag { font-size: .7rem; letter-spacing: .18em; text-transform: uppercase; color: var(--accent-ink); font-weight: 600; }
.featured h3 { font-family: var(--serif); font-weight: 500; font-size: clamp(1.35rem, 4vw, 1.8rem); line-height: 1.18; margin: .7rem 0 .6rem; text-wrap: balance; }
.featured p { color: var(--soft); font-size: clamp(.95rem, 2.4vw, 1rem); line-height: 1.7; }
.featured .row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: var(--space-2); border-top: 1px dotted var(--dot); padding-top: 1rem; }
.featured .meta { font-size: .82rem; color: var(--muted); }
.featured .go { font-size: .875rem; color: var(--accent-ink); font-weight: 500; white-space: nowrap; }

/* writing list */
.list { display: flex; flex-direction: column; }
.witem {
  display: flex; align-items: baseline; gap: 1.1rem;
  padding: 1.2rem var(--space-2); border-bottom: 1px dotted var(--dot);
  border-left: 3px solid transparent; border-radius: var(--radius-sm);
  transition: background .15s, border-color .15s, transform .15s;
}
.witem:first-child { border-top: 1px dotted var(--dot); }
.witem:hover { background: rgba(255,255,255,.6); border-left-color: var(--accent); }
.witem:active { transform: translateY(1px); }
.witem .no { font-family: var(--serif); font-style: italic; color: var(--accent); font-size: 1.05rem; min-width: 2rem; flex: none; }
.witem .t { font-family: var(--serif); font-size: 1.2rem; font-weight: 500; line-height: 1.25; transition: color .15s; }
.witem .t small { display: block; font-family: var(--sans); font-size: .8rem; color: var(--muted); font-weight: 400; margin-top: .2rem; }
.witem .k { margin-left: auto; font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); white-space: nowrap; flex: none; transition: color .15s, transform .15s; }
.witem:hover .t { color: var(--accent-ink); }
.witem:hover .k { color: var(--accent-ink); transform: translateX(3px); }

/* ---------- subscribe ---------- */
.subscribe { background: var(--ink); color: var(--paper); padding: var(--space-4) 0; }
.subscribe .wrap { text-align: center; }
.subscribe h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(1.7rem, 5.5vw, 2.4rem); line-height: 1.18; max-width: 24ch; margin: 0 auto; text-wrap: balance; }
.subscribe h2 em { font-style: italic; color: #E0A183; }
.subscribe p { color: #CFC8BA; font-size: .95rem; margin: var(--space-2) auto 0; max-width: 46ch; }
.form { display: flex; gap: .6rem; max-width: 460px; margin: var(--space-3) auto 0; }
.form input {
  flex: 1; min-width: 0; background: rgba(255,255,255,.03);
  border: 1px solid #5A554A; color: var(--paper);
  padding: .9rem 1rem; font-family: var(--sans); font-size: .95rem;
  border-radius: var(--radius-sm); transition: border-color .15s;
}
.form input::placeholder { color: #9A9384; }
.form input:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
.form button {
  background: var(--accent); border: none; color: #fff;
  padding: .9rem 1.4rem; font-family: var(--sans); font-weight: 600; font-size: .95rem;
  border-radius: var(--radius-sm); cursor: pointer; transition: background .15s; white-space: nowrap;
}
.form button:hover { background: var(--accent-ink); }
.form button:active { transform: translateY(1px); }
.form button:disabled { opacity: .6; cursor: default; }
.form-note { font-size: .8rem; margin-top: .6rem; min-height: 1.2em; }
.form-note.ok { color: #9ecfa0; }
.form-note.err { color: #e0a183; }
.subscribe .note { font-size: .78rem; color: #9A9384; margin-top: var(--space-2); }

/* ---------- about ---------- */
.about .g { display: grid; grid-template-columns: 1.35fr 1fr; gap: var(--space-3); align-items: start; }
.about h3 { font-family: var(--serif); font-weight: 400; font-size: clamp(1.6rem, 4.5vw, 1.85rem); line-height: 1.12; text-wrap: balance; }
.about h3 em { font-style: italic; color: var(--accent); }
.about p { color: var(--soft); font-size: clamp(.95rem, 2.4vw, 1rem); line-height: 1.75; margin-top: .9rem; }
.about .list { margin-top: var(--space-2); }
.about .list div { display: flex; justify-content: space-between; gap: 1rem; border-bottom: 1px solid var(--line); padding: .8rem 0; font-size: .95rem; }
.about .list div:last-child { border-bottom: none; }
.about .list span { color: var(--muted); flex: none; }

/* ---------- footer ---------- */
footer { border-top: 1px solid var(--line); background: rgba(255,255,255,.5); }
footer .inner {
  max-width: var(--max); margin: 0 auto;
  padding: var(--space-3) var(--gutter) var(--space-3);
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem;
}
footer .l { font-size: .875rem; color: var(--muted); }
footer nav { display: flex; gap: 1.5rem; font-size: .875rem; flex-wrap: wrap; }
footer a { color: var(--soft); transition: color .15s; }
footer a:hover { color: var(--accent-ink); }

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

/* ============================================================
   MOBILE-FIRST ADJUSTMENTS (everything above is already fluid)
   ============================================================ */
@media (max-width: 640px) {
  .about .g { grid-template-columns: 1fr; gap: var(--space-2); }
  .witem .k { display: none; }
  .witem { padding: 1.1rem var(--space-1); gap: .9rem; }
  .form { flex-direction: column; }
  .form input, .form button { width: 100%; }
  .contact { display: none; } /* nav stays clean on small screens */
  .sec-h { flex-direction: column; align-items: flex-start; gap: .25rem; }
  .featured { padding: 1.4rem 1.25rem; }
  header .inner { padding-top: .8rem; padding-bottom: .8rem; }
}

/* allow the hero to reach full display size only on big screens */
@media (min-width: 700px) {
  h1 { font-size: clamp(2.6rem, 6.2vw, 3.75rem); }
}


/* ============ MOBILE MENU (added) ============ */
.menu-btn{border:none;background:none;cursor:pointer;padding:0;width:42px;height:42px;display:none;flex-direction:column;align-items:center;justify-content:center;gap:5px;border-radius:8px;flex:none}
.menu-btn span{display:block;width:20px;height:2px;background:var(--ink);border-radius:2px;transition:transform .18s ease,opacity .18s ease}
.menu-btn:hover span,.menu-btn:focus-visible span{background:var(--accent)}
.menu-btn[aria-expanded="true"] span:nth-child(1){transform:translateY(7px) rotate(45deg)}
.menu-btn[aria-expanded="true"] span:nth-child(2){opacity:0}
.menu-btn[aria-expanded="true"] span:nth-child(3){transform:translateY(-7px) rotate(-45deg)}
.mobile-menu{display:none}
.mobile-menu.open{display:block;border-bottom:1px solid var(--dot);background:#FDFCF9;box-shadow:0 24px 40px -28px rgba(27,24,20,.4)}
.mobile-menu nav{max-width:var(--max,680px);margin:0 auto;padding:.5rem 1.25rem 1.1rem;display:flex;flex-direction:column;gap:0}
.mobile-menu a{display:flex;align-items:center;justify-content:space-between;gap:1rem;padding:1rem 0;border-bottom:1px solid var(--dot);font-family:var(--serif);font-size:1.15rem;line-height:1.2;color:var(--ink);transition:color .15s}
.mobile-menu a:last-child{border-bottom:none}
.mobile-menu a::after{content:"\2192";font-family:var(--sans);color:var(--accent);font-size:.95rem;flex:none;transition:transform .15s}
.mobile-menu a:hover{color:var(--accent)}
.mobile-menu a:hover::after{transform:translateX(3px)}
@media (max-width:640px){header nav{display:none}.menu-btn{display:flex}}
@media (min-width:641px){.menu-btn{display:none!important}.mobile-menu{display:none!important}}
