/* ==========================================================================
   Nishtha Gupta — portfolio
   Theme: terminal light, with a dark mode toggle.
   Plain CSS. No build step, no preprocessor, no framework.

   Colour is defined once as custom properties. Light is the default;
   [data-theme="dark"] overrides them, and prefers-color-scheme picks the
   starting mode for anyone who hasn't chosen. Nothing else in this file
   references a literal colour, so retheming means editing the block below.

   Measured contrast (light / dark):
     ink   16.26 / 16.02      body   9.35 / 9.91
     muted  5.16 /  6.07      amber  5.62 / 10.60
   All clear WCAG AA. `muted` is the one to re-check if you touch it — at
   11px it is the first thing to fail, in either mode.
   ========================================================================== */

:root {
  --paper: #fbf7ef;
  --surface: #fffdf8;
  --raised: #f1ebdd;
  --line: #e2dacb;
  --line-strong: #cec4b0;

  --ink: #1c1a16;
  --body: #46423a;
  --muted: #6e6860;

  --accent: #8f5600;
  --accent-ink: #ffffff;
  --green: #0f7a57;

  --mono: ui-monospace, "SF Mono", SFMono-Regular, "JetBrains Mono", Menlo,
    Consolas, "Liberation Mono", monospace;

  --wrap: 1180px;
  --gutter: 1.25rem;

  color-scheme: light;
}

[data-theme="dark"] {
  --paper: #14120f;
  --surface: #1c1a16;
  --raised: #24211b;
  --line: #322e26;
  --line-strong: #4a443a;

  --ink: #f2ede3;
  --body: #c3bcaf;
  --muted: #9a9284;

  --accent: #ffb454;
  --accent-ink: #14120f;
  --green: #4ed9a4;

  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #14120f;
    --surface: #1c1a16;
    --raised: #24211b;
    --line: #322e26;
    --line-strong: #4a443a;

    --ink: #f2ede3;
    --body: #c3bcaf;
    --muted: #9a9284;

    --accent: #ffb454;
    --accent-ink: #14120f;
    --green: #4ed9a4;

    color-scheme: dark;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background-color: var(--paper);
  color: var(--body);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  color: var(--ink);
  font-family: var(--mono);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

p {
  margin: 0;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

a {
  color: var(--accent);
  text-underline-offset: 3px;
}

a:hover {
  text-decoration-thickness: 2px;
}

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

::selection {
  background: var(--accent);
  color: var(--accent-ink);
}

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

@media (min-width: 640px) {
  .wrap {
    padding: 0 2rem;
  }
}

.skip {
  position: absolute;
  left: -9999px;
}

.skip:focus {
  left: 1rem;
  top: 1rem;
  z-index: 60;
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: var(--accent-ink);
}

/* Shell-prompt label. The $ is decorative, so it lives in CSS rather than
   in the markup — a screen reader reads the label, not the punctuation. */
.eyebrow {
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--muted);
  text-transform: lowercase;
}

.eyebrow::before {
  content: "$ ";
  color: var(--accent);
}

/* --- nav ----------------------------------------------------------------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.nav .wrap {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding-top: 0.7rem;
  padding-bottom: 0.7rem;
}

.nav__name {
  flex-shrink: 0;
  color: var(--ink);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
}

.nav__name::before {
  content: "~/ ";
  color: var(--accent);
}

.nav__links {
  display: flex;
  flex: 1;
  gap: 0.15rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.nav__links::-webkit-scrollbar {
  display: none;
}

.nav__links a {
  display: block;
  padding: 0.3rem 0.55rem;
  font-size: 12px;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
}

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

.nav__links a[aria-current="true"] {
  color: var(--ink);
  border-bottom-color: var(--accent);
}

.theme-toggle {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.3rem 0.65rem;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-family: inherit;
  font-size: 11px;
  cursor: pointer;
}

.theme-toggle:hover {
  border-color: var(--line-strong);
  color: var(--ink);
}

.theme-toggle::before {
  content: "";
  width: 7px;
  height: 7px;
  background: var(--accent);
}

/* --- buttons ------------------------------------------------------------- */

.btn {
  display: inline-block;
  padding: 0.55rem 1.1rem;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--body);
  font-family: inherit;
  font-size: 13px;
  text-decoration: none;
  cursor: pointer;
}

.btn:hover {
  border-color: var(--accent);
  color: var(--ink);
}

.btn--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.btn--primary:hover {
  color: var(--accent-ink);
  opacity: 0.88;
}

/* --- hero ---------------------------------------------------------------- */

.hero {
  padding: 4.5rem 0 3rem;
}

.hero h1 {
  font-size: clamp(2.1rem, 6vw, 3.9rem);
}

.hero__meta {
  margin-top: 0.5rem;
  font-size: 12.5px;
  color: var(--muted);
}

.hero__headline {
  margin-top: 2rem;
  max-width: 24ch;
  font-size: clamp(1.25rem, 2.9vw, 1.9rem);
  line-height: 1.35;
  color: var(--ink);
  font-weight: 500;
  letter-spacing: -0.015em;
}

.hero__sub {
  margin-top: 0.85rem;
  max-width: 60ch;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin-top: 1.6rem;
  padding: 0.35rem 0.8rem;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 12px;
  color: var(--green);
}

.status::before {
  content: "";
  width: 6px;
  height: 6px;
  background: var(--green);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.9rem;
}

/* --- metrics ------------------------------------------------------------- */

.metrics {
  display: grid;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  margin-top: 3.25rem;
}

@media (min-width: 720px) {
  .metrics {
    grid-template-columns: repeat(3, 1fr);
  }
}

.metric {
  background: var(--surface);
  padding: 1.4rem 1.3rem;
}

.metric__value {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 600;
  letter-spacing: -0.045em;
  color: var(--accent);
  line-height: 1;
}

.metric__label {
  margin-top: 0.65rem;
  font-size: 13px;
  color: var(--muted);
  max-width: 32ch;
  line-height: 1.6;
}

/* --- architecture diagram ------------------------------------------------ */

.diagram {
  margin: 3.25rem 0 0;
  padding: 1.5rem 1.4rem 1.3rem;
  border: 1px solid var(--line);
  background: var(--surface);
}

.diagram svg {
  display: block;
  width: 100%;
  height: auto;
  margin-top: 1.1rem;
}

.diagram__caption {
  margin-top: 1.1rem;
  font-size: 13px;
  color: var(--muted);
  max-width: 78ch;
  line-height: 1.65;
}

.node-box {
  fill: var(--raised);
  stroke: var(--line-strong);
}

.node-label {
  font-family: var(--mono);
  font-size: 11px;
  fill: var(--ink);
}

.node-sub {
  font-family: var(--mono);
  font-size: 9px;
  fill: var(--muted);
}

.flow-line {
  stroke: var(--line-strong);
  stroke-width: 1.5;
  fill: none;
}

.packet {
  fill: var(--accent);
}

.packet--a {
  animation: flow-a 3.2s linear infinite;
}

.packet--b {
  animation: flow-b 3.2s linear infinite 0.45s;
}

.packet--c {
  animation: flow-c 3.2s linear infinite 0.9s;
}

@keyframes flow-a {
  0% {
    transform: translateX(0);
    opacity: 0;
  }
  12%,
  88% {
    opacity: 1;
  }
  100% {
    transform: translateX(118px);
    opacity: 0;
  }
}

@keyframes flow-b {
  0% {
    transform: translate(0, 0);
    opacity: 0;
  }
  12%,
  88% {
    opacity: 1;
  }
  100% {
    transform: translate(112px, -30px);
    opacity: 0;
  }
}

@keyframes flow-c {
  0% {
    transform: translate(0, 0);
    opacity: 0;
  }
  12%,
  88% {
    opacity: 1;
  }
  100% {
    transform: translate(112px, 30px);
    opacity: 0;
  }
}

/* --- sections ------------------------------------------------------------ */

.section {
  padding: 4rem 0;
  border-top: 1px solid var(--line);
  scroll-margin-top: 4.5rem;
}

.section__title {
  margin-top: 0.8rem;
  font-size: clamp(1.35rem, 2.6vw, 1.75rem);
  max-width: 28ch;
}

.section__body {
  margin-top: 2.25rem;
}

.grid-2 {
  display: grid;
  gap: 2.25rem;
}

@media (min-width: 960px) {
  .grid-2 {
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  }

  .grid-2--even {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.prose p + p {
  margin-top: 1rem;
}

.prose p {
  max-width: 68ch;
}

.card {
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 1.4rem;
}

@media (min-width: 640px) {
  .card--lg {
    padding: 1.9rem;
  }
}

/* --- lists --------------------------------------------------------------- */

.bullets li {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.7rem;
}

/* Terminal-style marker rather than a bullet glyph. */
.bullets li::before {
  content: "›";
  flex-shrink: 0;
  color: var(--accent);
  line-height: 1.75;
}

.bullets--quiet li::before {
  color: var(--line-strong);
}

.bullets span {
  max-width: 78ch;
  font-size: 14px;
  line-height: 1.7;
}

/* --- tags ---------------------------------------------------------------- */

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 0.5rem;
  margin-top: 1.4rem;
}

.tag {
  font-size: 11.5px;
  color: var(--muted);
}

.tag::before {
  content: "[";
  color: var(--line-strong);
}

.tag::after {
  content: "]";
  color: var(--line-strong);
}

/* --- projects ------------------------------------------------------------ */

.project + .project {
  margin-top: 1rem;
}

.project__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.4rem 1rem;
}

.project__head h3 {
  font-size: 1.25rem;
}

.project__role {
  font-size: 11px;
  color: var(--muted);
}

.project__pitch {
  margin-top: 0.7rem;
  max-width: 74ch;
  font-size: 14px;
}

.compact-grid {
  display: grid;
  gap: 1rem;
  margin-top: 1.4rem;
}

@media (min-width: 760px) {
  .compact-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.compact h4 {
  font-size: 1rem;
}

.compact p {
  margin-top: 0.5rem;
  font-size: 13.5px;
}

/* --- skills -------------------------------------------------------------- */

.skill-group + .skill-group {
  margin-top: 1.5rem;
}

.skill-group .tags {
  margin-top: 0.6rem;
}

.caveat {
  margin-top: 0.45rem;
  max-width: 52ch;
  font-size: 13px;
  color: var(--muted);
}

/* --- timeline ------------------------------------------------------------ */

.timeline {
  border-left: 1px solid var(--line);
  padding-left: 1.6rem;
}

.timeline > li + li {
  margin-top: 2.75rem;
}

.timeline > li {
  position: relative;
}

.timeline > li::before {
  content: "";
  position: absolute;
  left: -1.6rem;
  top: 0.55rem;
  transform: translateX(-50%);
  width: 7px;
  height: 7px;
  background: var(--line-strong);
}

.timeline > li.is-current::before {
  background: var(--green);
}

.role__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.2rem 1rem;
}

.role__head h3 {
  font-size: 1.1rem;
}

.role__dates {
  font-size: 11.5px;
  color: var(--muted);
}

.role__company {
  margin-top: 0.2rem;
  font-size: 14px;
  color: var(--accent);
}

.role__company span {
  color: var(--muted);
}

.award {
  display: inline-block;
  margin-top: 0.65rem;
  padding: 0.15rem 0.5rem;
  border: 1px solid var(--line);
  background: var(--raised);
  font-size: 11px;
  color: var(--accent);
}

.role__note {
  margin-top: 0.9rem;
  padding-left: 0.9rem;
  border-left: 2px solid var(--line);
  max-width: 74ch;
  font-size: 13px;
  color: var(--muted);
}

/* --- certifications ------------------------------------------------------ */

.certs li {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.9rem;
}

.certs li::before {
  content: "";
  flex-shrink: 0;
  width: 7px;
  height: 7px;
  margin-top: 0.62rem;
  background: var(--green);
}

.certs li.is-planned::before {
  background: var(--line-strong);
}

.certs strong {
  display: block;
  font-weight: 500;
  font-size: 13.5px;
  color: var(--ink);
  line-height: 1.5;
}

.certs em {
  display: block;
  margin-top: 0.1rem;
  font-size: 11px;
  font-style: normal;
  color: var(--muted);
}

/* --- form ---------------------------------------------------------------- */

.field {
  display: block;
  margin-top: 0.9rem;
}

.field span {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 11px;
  color: var(--muted);
}

.field input,
.field textarea {
  width: 100%;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font-family: inherit;
  font-size: 14px;
}

.field textarea {
  resize: vertical;
  min-height: 7.5rem;
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.honeypot {
  position: absolute;
  left: -9999px;
}

.form__status {
  min-height: 1.5rem;
  margin-top: 0.8rem;
  font-size: 12px;
}

.form__status.is-ok {
  color: var(--green);
}

.form__status.is-error {
  color: var(--accent);
}

.contact-aside__group + .contact-aside__group {
  margin-top: 1.9rem;
}

.contact-aside a {
  font-size: 14px;
}

/* --- footer -------------------------------------------------------------- */

.footer {
  border-top: 1px solid var(--line);
  padding: 2.25rem 0;
  font-size: 11.5px;
  color: var(--muted);
}

/* --- motion preference --------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .packet {
    display: none;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ==========================================================================
   Print — minimal only.

   The previous version tried to reformat this page into a one-page resume.
   That was the wrong tool: a resume has a fixed budget and needs editorial
   selection, which a stylesheet over a portfolio cannot do well. The real
   resume is the compiled LaTeX PDF linked in the contact section.

   What remains here just stops a printed page looking broken: force light,
   drop the interactive chrome, keep the text readable.
   ========================================================================== */

@media print {
  @page {
    margin: 16mm;
  }

  :root,
  [data-theme="dark"] {
    --paper: #fff;
    --surface: #fff;
    --raised: #fff;
    --line: #ccc;
    --line-strong: #999;
    --ink: #000;
    --body: #1a1a1a;
    --muted: #444;
    --accent: #000;
    --green: #000;
  }

  .nav,
  .theme-toggle,
  .hero__actions,
  .form,
  .skip,
  .footer {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
  }

  .wrap {
    max-width: none;
    padding: 0;
  }

  .section {
    break-inside: avoid;
  }

  a {
    color: #000;
  }
}
