/* ==========================================================================
   anuragrana.in — design tokens
   Direction: "instrumentation". Ink on paper, one signal colour (healthy
   green, borrowed from monitoring), hairline rules, mono for anything that
   is a measurement.
   ========================================================================== */

:root {
  --paper:      #fafaf8;
  --paper-2:    #f1f1ed;
  --ink:        #14161a;
  --ink-2:      #4a4e56;
  --ink-3:      #757a83;
  --rule:       #dededa;
  --rule-soft:  #eaeae6;
  --signal:     #0e7a4f;
  --signal-2:   #e4f0ea;
  --flag:       #8a5a00;
  --flag-bg:    #fdf6e6;

  --sans:  "Archivo", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --mono:  "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --t-display: clamp(2.35rem, 5.6vw, 3.7rem);
  --t-h2:      clamp(1.45rem, 2.8vw, 1.95rem);
  --t-h3:      1.1rem;
  --t-lede:    clamp(1.08rem, 1.6vw, 1.25rem);
  --t-body:    1.0625rem;
  --t-small:   0.9375rem;
  --t-label:   0.6875rem;
  --t-metric:  clamp(2.1rem, 4.6vw, 2.9rem);

  --col:       42rem;
  --band-y:    clamp(3.25rem, 7vw, 5.25rem);

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper:     #0e1013;
    --paper-2:   #16191e;
    --ink:       #ecedef;
    --ink-2:     #a6abb4;
    --ink-3:     #6e747e;
    --rule:      #262a31;
    --rule-soft: #1c2026;
    --signal:    #46b889;
    --signal-2:  #14261f;
    --flag:      #d3a24c;
    --flag-bg:   #221c10;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --paper:     #0e1013;
  --paper-2:   #16191e;
  --ink:       #ecedef;
  --ink-2:     #a6abb4;
  --ink-3:     #6e747e;
  --rule:      #262a31;
  --rule-soft: #1c2026;
  --signal:    #46b889;
  --signal-2:  #14261f;
  --flag:      #d3a24c;
  --flag-bg:   #221c10;
  color-scheme: dark;
}

/* ==========================================================================
   base
   ========================================================================== */

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

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: var(--t-body);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  font-family: var(--sans);
  font-weight: 700;
  letter-spacing: -0.022em;
  line-height: 1.12;
  margin: 0;
  text-wrap: balance;
}

p { margin: 0 0 1rem; }
p:last-child { margin-bottom: 0; }

a { color: inherit; }

img { max-width: 100%; display: block; }

hr { border: 0; border-top: 1px solid var(--rule); margin: 0; }

::selection { background: var(--signal); color: var(--paper); }

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

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--mono);
  font-size: var(--t-small);
  padding: 0.6rem 1rem;
  z-index: 100;
}
.skip:focus { left: 0; }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ==========================================================================
   top bar
   ========================================================================== */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1.25rem;
  /* .topbar--always pages centre their contents with .topbar__inner */
  background: color-mix(in srgb, var(--paper) 90%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
}

.topbar__name {
  font-family: var(--mono);
  font-size: var(--t-small);
  font-weight: 500;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  max-width: 54rem;
  margin: 0 auto;
}

.topbar__links { display: flex; align-items: center; gap: 1rem; }

.topbar__link {
  font-family: var(--mono);
  font-size: var(--t-label);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-2);
  text-decoration: none;
}
.topbar__link:hover { color: var(--ink); }

/* below ~370px the bar has room for the name, one link and the toggle */
@media (max-width: 23.5rem) { .topbar__link--opt { display: none; } }

.main { min-width: 0; }

.col {
  width: 100%;
  max-width: var(--col);
  margin: 0 auto;
  padding: 0 1.25rem;
}

.col--wide { max-width: 58rem; }

/* ==========================================================================
   bands
   ========================================================================== */

.band { padding-block: var(--band-y); border-top: 1px solid var(--rule); }
.band--first { padding-block: clamp(2.5rem, 6vw, 4.5rem) var(--band-y); border-top: 0; }
.band--tint { background: var(--paper-2); }
/* off-hours: deliberately the quietest band on the page */
.band--slim { padding-block: clamp(2rem, 4vw, 2.75rem); }
.minor { font-size: var(--t-small); color: var(--ink-3); max-width: 40rem; margin: 0; }
.minor a { color: var(--ink-2); }
.sect--minor { font-size: 0.9rem; color: var(--ink-3); margin-bottom: 0.8rem; }

.eyebrow {
  font-family: var(--mono);
  font-size: var(--t-label);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 1.4rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
}
.eyebrow::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--rule);
}

/* section heading: one plain noun, no editorial second deck.
   .eyebrow is the 404 page's variant. */
.sect {
  display: flex;
  align-items: baseline;
  gap: 0.85rem;
  font-family: var(--sans);
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin: 0 0 1.35rem;
}
.sect::after { content: ""; flex: 1; height: 1px; background: var(--rule); }

.sect__note {
  font-family: var(--mono);
  font-size: var(--t-label);
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.band__intro {
  color: var(--ink-2);
  max-width: 34rem;
  margin: 0 0 2.25rem;
}

/* ==========================================================================
   hero
   ========================================================================== */

.hero__status {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--mono);
  font-size: var(--t-label);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--signal);
  background: var(--signal-2);
  border: 1px solid color-mix(in srgb, var(--signal) 30%, transparent);
  border-radius: 100px;
  padding: 0.32rem 0.75rem 0.32rem 0.6rem;
  margin-bottom: 1.6rem;
}

.hero__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--signal);
  animation: pulse 2.6s ease-in-out infinite;
}

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

.hero__title { font-size: var(--t-display); margin: 0 0 1.15rem; }

.hero__lede {
  font-size: var(--t-lede);
  color: var(--ink-2);
  max-width: 33rem;
  margin: 0 0 1.75rem;
}

.hero__meta {
  font-family: var(--mono);
  font-size: var(--t-small);
  color: var(--ink-2);
  line-height: 1.9;
  margin: 0 0 2rem;
  padding-left: 0.9rem;
  border-left: 2px solid var(--rule);
}
.hero__meta strong { font-weight: 500; color: var(--ink); }

.hero__portrait {
  width: 104px;
  height: 104px;
  object-fit: cover;
  border: 1px solid var(--rule);
  border-radius: 3px;
  margin-bottom: 1.75rem;
  filter: grayscale(100%) contrast(1.04);
  transition: filter 0.4s ease;
}
.hero__portrait:hover { filter: grayscale(0%); }

/* ==========================================================================
   buttons
   ========================================================================== */

.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--sans);
  font-size: var(--t-small);
  font-weight: 600;
  letter-spacing: -0.005em;
  text-decoration: none;
  padding: 0.68rem 1.15rem;
  border-radius: 3px;
  border: 1px solid transparent;
  transition: transform 0.12s ease, background-color 0.16s ease, border-color 0.16s ease;
}
.btn:active { transform: translateY(1px); }

.btn--primary { background: var(--ink); color: var(--paper); }
.btn--primary:hover { background: var(--signal); }

.btn--ghost { border-color: var(--rule); color: var(--ink); }
.btn--ghost:hover { border-color: var(--ink); background: var(--paper-2); }

/* ==========================================================================
   readings (metric strip)
   ========================================================================== */

/* ==========================================================================
   service entries
   ========================================================================== */

/* ==========================================================================
   timeline
   ========================================================================== */

/* ==========================================================================
   project cards
   ========================================================================== */

.projects {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 1fr);
}

.project {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 1.3rem 1.35rem 1.4rem;
  background: var(--paper);
  transition: border-color 0.18s ease, transform 0.18s ease;
}
.project:hover { border-color: var(--ink-3); transform: translateY(-2px); }

.project__kind {
  font-family: var(--mono);
  font-size: var(--t-label);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 0.7rem;
}

.project__name { font-size: var(--t-h3); margin-bottom: 0.5rem; }

.project__body { color: var(--ink-2); font-size: var(--t-small); flex: 1; }

.project__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  margin-top: 1.05rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--rule-soft);
}

.project__link {
  font-family: var(--mono);
  font-size: var(--t-small);
  color: var(--signal);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
.project__link:hover { border-bottom-color: currentColor; }

/* ==========================================================================
   repo table
   ========================================================================== */

/* ==========================================================================
   links list (contact)
   ========================================================================== */

.links { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }

.link-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 1rem;
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--rule-soft);
}

/* stacks the address over its one-line description */
.link-row__body { display: flex; flex-direction: column; gap: 0.2rem; flex: 1 1 15rem; min-width: 0; }

.link-row__note { font-size: var(--t-small); color: var(--ink-2); line-height: 1.45; }

/* the one row meant to be acted on rather than read */
.link-row--feature {
  align-items: center;
  background: var(--signal-2);
  border-left: 2px solid var(--signal);
  border-bottom-color: var(--rule);
  padding: 1.05rem 1rem;
}

.link-row__cta {
  flex: 0 0 auto;
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--sans);
  font-size: var(--t-small);
  font-weight: 600;
  text-decoration: none;
  color: var(--paper);
  background: var(--signal);
  border-radius: 3px;
  padding: 0.5rem 0.9rem;
  transition: transform 0.12s ease, background-color 0.16s ease;
}
.link-row__cta:hover { background: var(--ink); }
.link-row__cta:active { transform: translateY(1px); }

.link-row__key {
  font-family: var(--mono);
  font-size: var(--t-label);
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--ink-3);
  min-width: 7.5rem;
}

.link-row__val {
  font-family: var(--mono);
  font-size: var(--t-small);
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
  word-break: break-word;
}
.link-row__val:hover { color: var(--signal); border-bottom-color: var(--signal); }

/* ==========================================================================
   call to action
   ========================================================================== */

.cta {
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: clamp(1.5rem, 4vw, 2.35rem);
  background: var(--paper-2);
}

.cta__title { font-size: var(--t-h2); margin-bottom: 0.75rem; }
.cta__body { color: var(--ink-2); max-width: 30rem; margin-bottom: 1.5rem; }

/* ==========================================================================
   consulting page pieces
   ========================================================================== */

.package {
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 1.4rem 1.4rem 1.5rem;
  margin-bottom: 1rem;
  background: var(--paper);
}
.package--lead { border-color: var(--signal); }

.package__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-bottom: 0.9rem;
}

.package__name { font-size: var(--t-h3); }

.package__price {
  font-family: var(--mono);
  font-size: var(--t-small);
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}

.package__body { color: var(--ink-2); font-size: var(--t-small); }

.package__list { margin: 0.9rem 0 0; padding-left: 1.1rem; color: var(--ink-2); font-size: var(--t-small); }
.package__list li { margin-bottom: 0.3rem; }

.steps { list-style: none; counter-reset: step; margin: 0; padding: 0; }

.step {
  counter-increment: step;
  position: relative;
  padding: 0 0 1.6rem 3rem;
  border-left: 1px solid var(--rule);
}
.step:last-child { padding-bottom: 0; border-left-color: transparent; }

.step::before {
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: -0.95rem;
  top: 0;
  width: 1.9rem;
  height: 1.9rem;
  display: grid;
  place-items: center;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 50%;
  font-family: var(--mono);
  font-size: var(--t-label);
  color: var(--ink-2);
}

.band--tint .step::before { background: var(--paper-2); }

.step__title { font-size: var(--t-h3); margin-bottom: 0.3rem; }
.step__body { color: var(--ink-2); font-size: var(--t-small); }

.nots { list-style: none; margin: 0; padding: 0; }
.nots li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 0.6rem;
  color: var(--ink-2);
}
.nots li::before {
  content: "\00d7";
  position: absolute;
  left: 0.15rem;
  top: -0.05rem;
  font-family: var(--mono);
  color: var(--ink-3);
}

/* ==========================================================================
   placeholder marker — anything Anurag still has to fill in
   ========================================================================== */

.tbd {
  color: var(--flag);
  background: var(--flag-bg);
  border-bottom: 1px dashed currentColor;
  font-family: var(--mono);
  font-size: 0.9em;
  padding: 0 0.2em;
  border-radius: 2px;
}

/* ==========================================================================
   footer
   ========================================================================== */

.foot {
  border-top: 1px solid var(--rule);
  padding: 2rem 0 2.75rem;
  font-family: var(--mono);
  font-size: var(--t-label);
  letter-spacing: 0.06em;
  color: var(--ink-3);
}

.foot__inner { display: flex; flex-wrap: wrap; gap: 0.6rem 1.5rem; justify-content: space-between; }

.foot a { color: var(--ink-2); text-decoration: none; border-bottom: 1px solid var(--rule); }
.foot a:hover { color: var(--ink); }

.theme-toggle {
  font: inherit;
  font-family: var(--mono);
  letter-spacing: 0.06em;
  background: none;
  border: 0;
  padding: 0;
  color: var(--ink-3);
  cursor: pointer;
  text-transform: uppercase;
}
.theme-toggle:hover { color: var(--ink); }

/* ==========================================================================
   prose links inside body copy
   ========================================================================== */

/* ==========================================================================
   responsive
   ========================================================================== */


@media (min-width: 46rem) {
  .projects { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 68rem) {

  .topbar { display: none; }
  .topbar--always { display: block; }

  .col { padding-inline: 3rem; }
  .topbar { padding-inline: 3rem; }
  .col--wide { max-width: 54rem; }
}

@media (min-width: 90rem) {
  .col { padding-inline: 5rem; }
}
