/* ============================================================
   Rohit Ushir — Portfolio
   Design system: warm minimal, typography-led, light-first.
   ============================================================ */

/* ---- Tokens ---- */
:root {
  --ink:        #1a1815;
  --ink-soft:   #55504a;
  --ink-faint:  #8a827a;
  --bg:         #f7f4ef;
  --bg-raised:  #fffdf9;
  --line:       #e4ddd2;
  --line-soft:  #efe9df;
  --accent:     #c2410c;   /* warm terracotta */
  --accent-ink: #9a340a;

  --font-sans:   "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --font-serif:  "Fraunces", Georgia, "Times New Roman", serif;
  --font-mono:   "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --wrap: 1080px;
  --pad: clamp(1.25rem, 5vw, 3rem);

  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 22px;

  --shadow: 0 1px 2px rgba(26, 24, 21, 0.04), 0 8px 30px rgba(26, 24, 21, 0.05);

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

:root[data-theme="dark"] {
  --ink:        #ece7df;
  --ink-soft:   #b3aca2;
  --ink-faint:  #7d766c;
  --bg:         #17150f;
  --bg-raised:  #201d16;
  --line:       #322d24;
  --line-soft:  #2a251d;
  --accent:     #f97316;
  --accent-ink: #fb923c;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 34px rgba(0, 0, 0, 0.32);
}

/* ---- Reset-ish ---- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color 0.4s var(--ease), color 0.4s var(--ease);
  overflow-x: hidden;
}
h1, h2, h3 { font-family: var(--font-serif); font-weight: 500; line-height: 1.1; margin: 0; letter-spacing: -0.01em; }
p { margin: 0 0 1rem; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul, ol { margin: 0; padding: 0; list-style: none; }
em { font-style: italic; color: var(--accent); }
::selection { background: var(--accent); color: #fff; }

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

/* ---- Skip link ---- */
.skip-link {
  position: absolute; left: 50%; transform: translateX(-50%) translateY(-150%);
  top: 0.5rem; z-index: 100; background: var(--ink); color: var(--bg);
  padding: 0.55rem 1rem; border-radius: var(--r-sm); font-size: 0.9rem;
  transition: transform 0.2s var(--ease);
}
.skip-link:focus { transform: translateX(-50%) translateY(0); }

/* ---- Nav ---- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease), background-color 0.3s var(--ease);
}
.nav.is-scrolled { border-bottom-color: var(--line); }
.nav__inner { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.nav__mark {
  font-family: var(--font-mono); font-weight: 500; font-size: 1.05rem;
  letter-spacing: 0.04em; border: 1.5px solid var(--ink); border-radius: var(--r-sm);
  padding: 0.2rem 0.5rem; transition: color 0.2s, border-color 0.2s;
}
.nav__brand:hover .nav__mark { color: var(--accent); border-color: var(--accent); }
.nav__links { display: flex; gap: clamp(1rem, 2.5vw, 2rem); }
.nav__links a {
  font-size: 0.95rem; color: var(--ink-soft); position: relative; padding: 0.25rem 0;
  transition: color 0.2s var(--ease);
}
.nav__links a::after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 1.5px; width: 0;
  background: var(--accent); transition: width 0.25s var(--ease);
}
.nav__links a:hover { color: var(--ink); }
.nav__links a:hover::after { width: 100%; }

.theme-toggle {
  display: grid; place-items: center; width: 40px; height: 40px;
  border: 1px solid var(--line); border-radius: 50%; background: var(--bg-raised);
  cursor: pointer; color: var(--ink); transition: border-color 0.2s, transform 0.2s var(--ease);
}
.theme-toggle:hover { border-color: var(--ink-faint); transform: rotate(15deg); }
.theme-toggle__icon { width: 16px; height: 16px; border-radius: 50%; position: relative; background: var(--ink); }
.theme-toggle__icon::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: var(--bg-raised); transform: translate(4px, -4px) scale(0.85);
  transition: transform 0.3s var(--ease);
}
:root[data-theme="dark"] .theme-toggle__icon::after { transform: translate(6px, -6px) scale(0); }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-size: 0.98rem; font-weight: 500; padding: 0.75rem 1.35rem;
  border-radius: 999px; border: 1.5px solid transparent; cursor: pointer;
  transition: transform 0.2s var(--ease), background-color 0.2s, color 0.2s, border-color 0.2s;
}
.btn:hover { transform: translateY(-2px); }
.btn--solid { background: var(--ink); color: var(--bg); }
.btn--solid:hover { background: var(--accent); }
.btn--ghost { border-color: var(--line); color: var(--ink); }
.btn--ghost:hover { border-color: var(--ink); }

/* ---- Shared type ---- */
.eyebrow {
  font-family: var(--font-mono); font-size: 0.82rem; letter-spacing: 0.02em;
  color: var(--ink-faint); text-transform: none; margin-bottom: 1.5rem;
}
.label {
  font-family: var(--font-mono); font-size: 0.82rem; color: var(--accent);
  margin-bottom: 0.9rem; letter-spacing: 0.02em;
}
.section__title { font-size: clamp(1.75rem, 4vw, 2.5rem); margin-bottom: 1.5rem; }
.section__intro { color: var(--ink-soft); max-width: 60ch; margin-bottom: 2.5rem; }
.muted { color: var(--ink-faint); }

/* ---- Hero ---- */
.hero { padding-top: clamp(4rem, 12vh, 8rem); padding-bottom: clamp(4rem, 10vh, 7rem); }
.hero__title {
  font-size: clamp(2.6rem, 8vw, 5rem); font-weight: 400; margin-bottom: 1.75rem;
  max-width: 16ch;
}
.hero__lede { font-size: clamp(1.05rem, 1.6vw, 1.25rem); color: var(--ink-soft); max-width: 58ch; margin-bottom: 2.25rem; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 0.85rem; margin-bottom: 2.5rem; }
.hero__links { display: flex; gap: 1.5rem; }
.hero__links a {
  font-family: var(--font-mono); font-size: 0.9rem; color: var(--ink-soft);
  position: relative; transition: color 0.2s;
}
.hero__links a::before { content: "→ "; color: var(--accent); }
.hero__links a:hover { color: var(--ink); }

/* ---- Sections ---- */
.section { padding-block: clamp(3.5rem, 9vh, 6rem); border-top: 1px solid var(--line-soft); }

/* ---- About ---- */
.about__grid { display: grid; grid-template-columns: 1fr; gap: 1rem 4rem; }
.about__body { max-width: 66ch; }
.about__body p { color: var(--ink-soft); }
.principles {
  margin-top: 2.5rem; display: grid; gap: 0.15rem;
  border-top: 1px solid var(--line); padding-top: 1.5rem;
}
.principles li {
  display: flex; align-items: baseline; gap: 1rem; padding: 0.55rem 0;
  font-family: var(--font-serif); font-size: 1.15rem; color: var(--ink);
  border-bottom: 1px solid var(--line-soft);
}
.principles li:last-child { border-bottom: none; }
.principles span { font-family: var(--font-mono); font-size: 0.8rem; color: var(--accent); min-width: 1.5rem; }

/* ---- Timeline / Work ---- */
.timeline { display: grid; gap: 2.5rem; }
.timeline__item {
  border-left: 2px solid var(--line); padding-left: clamp(1.25rem, 3vw, 2rem);
  position: relative;
}
.timeline__item::before {
  content: ""; position: absolute; left: -7px; top: 6px; width: 12px; height: 12px;
  border-radius: 50%; background: var(--bg); border: 2px solid var(--accent);
}
.timeline__head { margin-bottom: 0.75rem; }
.timeline__item h3 { font-size: 1.35rem; }
.timeline__meta { font-family: var(--font-mono); font-size: 0.85rem; color: var(--ink-faint); margin: 0.35rem 0 0; }
.timeline__item p { color: var(--ink-soft); max-width: 64ch; }
.metrics { display: grid; gap: 0.5rem; margin: 1rem 0 1.25rem; }
.metrics li { color: var(--ink-soft); font-size: 0.97rem; display: flex; gap: 0.7rem; align-items: baseline; }
.metrics strong { font-family: var(--font-serif); font-size: 1.15rem; color: var(--ink); min-width: 3rem; }

/* ---- Tags ---- */
.tags { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.1rem; }
.tags li {
  font-family: var(--font-mono); font-size: 0.78rem; color: var(--ink-soft);
  background: var(--bg-raised); border: 1px solid var(--line);
  padding: 0.3rem 0.65rem; border-radius: 999px;
}

/* ---- Projects ---- */
.projects { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1.5rem; }
.project {
  background: var(--bg-raised); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: clamp(1.5rem, 3vw, 2rem); box-shadow: var(--shadow);
  transition: transform 0.3s var(--ease), border-color 0.3s, box-shadow 0.3s;
}
.project:hover { transform: translateY(-4px); border-color: var(--ink-faint); }
.project__head { margin-bottom: 1.25rem; }
.project__head h3 { font-size: 1.3rem; }
.project__tag { font-family: var(--font-mono); font-size: 0.8rem; color: var(--accent); margin: 0.4rem 0 0; }
.project__pao { display: grid; gap: 1rem; margin: 0; }
.project__pao dt {
  font-family: var(--font-mono); font-size: 0.72rem; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--ink-faint); margin-bottom: 0.25rem;
}
.project__pao dd { margin: 0; color: var(--ink-soft); font-size: 0.97rem; }

/* ---- Skills ---- */
.skills { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 2rem; }
.skills__group h3 { font-size: 1.05rem; font-family: var(--font-sans); font-weight: 600; margin-bottom: 0.9rem; }
.skills__group ul { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.skills__group li {
  font-size: 0.9rem; color: var(--ink-soft); border: 1px solid var(--line);
  padding: 0.35rem 0.75rem; border-radius: var(--r-sm); background: var(--bg-raised);
}

/* ---- Education ---- */
.edu { display: grid; gap: 1.25rem; }
.edu__item { padding-bottom: 1.25rem; border-bottom: 1px solid var(--line-soft); }
.edu__item:last-child { border-bottom: none; }
.edu__item h3 { font-size: 1.2rem; display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; }
.badge {
  font-family: var(--font-mono); font-size: 0.7rem; font-weight: 500;
  color: var(--accent-ink); background: color-mix(in srgb, var(--accent) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  padding: 0.15rem 0.55rem; border-radius: 999px; letter-spacing: 0.03em;
}
.badge--soft { color: var(--ink-faint); background: transparent; border-color: var(--line); }

/* ---- Contact ---- */
.section--contact { text-align: center; padding-block: clamp(4rem, 11vh, 7rem); }
.contact__title { font-size: clamp(1.9rem, 5vw, 3rem); max-width: 18ch; margin: 0 auto 1.25rem; }
.contact__lede { color: var(--ink-soft); max-width: 52ch; margin: 0 auto 2.25rem; }
.contact__actions { display: flex; flex-wrap: wrap; gap: 0.85rem; justify-content: center; }

/* ---- Footer ---- */
.footer {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem;
  padding-block: 2.5rem; border-top: 1px solid var(--line-soft);
  font-size: 0.88rem; color: var(--ink-soft);
}
.footer p { margin: 0; }

/* ---- Reveal animation (progressive enhancement) ----
   Only hide when JS is active; without JS everything stays visible. */
html.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
html.js .reveal.is-visible { opacity: 1; transform: none; }

/* ---- Responsive ---- */
@media (min-width: 760px) {
  .about__grid { grid-template-columns: 240px 1fr; }
  .about__grid .section__title { position: sticky; top: 90px; align-self: start; }
}
@media (max-width: 620px) {
  .nav__links { display: none; }
}

/* ---- Reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
  .reveal { opacity: 1; transform: none; }
}
