/* ============================================================
   ramansodhi.com — styles.css

   One light theme, committed to on purpose. Green is the brand
   colour, split into two tokens: --accent for fills, rules and
   strokes (the portrait ring, the metric rules, tile hover), and
   --accent-ink for anything set as text, which is darkened enough
   to pass AA contrast.

   Language borrowed from the reference site:
     · a big first-person headline, one phrase in accent
     · the portrait sitting on a block of colour
     · company logos and names inline, no logo wall
     · work as large tinted cards with serif titles

   Type: a geometric sans carries the page, a serif sets the card
   titles, a mono handles labels. All system faces — nothing is
   downloaded, so there is no font flash.

   Written mobile-first: the base rules ARE the phone layout.

     1. Tokens
     2. Base
     3. Page, mark
     4. Hero, portrait, metrics
     5. Links
     6. Tools
     7. Work cards
     8. Footer
     9. 760px — two up
    10. 1100px — wide
    11. Reduced motion
   ============================================================ */

/* ---------- 1. Tokens ------------------------------------- */

:root {
  color-scheme: light;

  /* Raw palette — edit these to re-skin the page. */
  --ground:     #fbfbf8;
  --ink:        #0c1611;
  --muted:      #5d6b62;
  --accent:     #0e9d5c;   /* the green: fills, rules, strokes */
  --accent-ink: #0c7d4c;   /* the green as TEXT — passes AA (4.9:1) */
  --rule:       #e6e8e0;
  --tint-1:     #e4f4ea;   /* card tints, all one hue family */
  --tint-2:     #eef2e3;
  --tint-3:     #e2f1f0;
  --tint-4:     #e9f0dc;

  --sans:  system-ui, -apple-system, "Segoe UI", Roboto,
           "Helvetica Neue", Arial, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino,
           "Book Antiqua", Georgia, serif;
  --mono:  ui-monospace, SFMono-Regular, "SF Mono", Menlo,
           Consolas, monospace;

  --t-hero:  clamp(1.75rem, 6.2vw, 3.25rem);
  --t-card:  clamp(1.375rem, 4vw, 1.625rem);
  --t-body:  1.0625rem;
  --t-small: 0.9375rem;
  --t-micro: 0.75rem;

  --s-1: 0.25rem;
  --s-2: 0.5rem;
  --s-3: 0.875rem;
  --s-4: 1.5rem;
  --s-5: 2.5rem;
  --s-6: 4rem;

  --radius: 16px;
}

/* ---------- 2. Base --------------------------------------- */

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

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--t-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  /* No double-tap-to-zoom (so taps feel instant and stray double
     taps don't jump the page), but deliberate pinch-zoom still
     works for anyone who needs to magnify. */
  touch-action: manipulation;
}

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

a {
  color: inherit;
  text-decoration: none;
}

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

h1, h2, h3 {
  margin: 0;
}

img {
  max-width: 100%;
}

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

.sr-only,
.skip {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip:focus {
  width: auto;
  height: auto;
  clip-path: none;
  left: var(--s-4);
  top: var(--s-4);
  z-index: 2;
  padding: var(--s-2) var(--s-3);
  border-radius: 999px;
  background: var(--ground);
  border: 1px solid var(--accent);
  font-size: var(--t-small);
}

/* Scroll choreography: script.js tags elements below the hero with
   .rev, and they rise in as they enter the viewport — staggered by
   the --d index it assigns. Without JS nothing gets tagged, so the
   page renders fully visible. */
.rev {
  opacity: 0;
  transform: translateY(12px);
  transition:
    opacity 600ms ease,
    transform 600ms cubic-bezier(0.2, 0.7, 0.2, 1);
  transition-delay: calc(var(--d, 0) * 60ms);
}

.rev.in {
  opacity: 1;
  transform: none;
}

/* Section label, with a hairline running out to the margin. */
.label {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  margin: 0 0 var(--s-4);
  font-family: var(--mono);
  font-size: var(--t-micro);
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--rule);
}

/* ---------- 3. Page, mark --------------------------------- */

.page {
  max-width: 66rem;
  margin: 0 auto;
  padding: var(--s-4) var(--s-4) var(--s-5);
}

/* ---------- 4. Hero --------------------------------------- */

/* Portrait and name are one unit, so the gap between them stays
   tight; the 760px query opens it up for the two-column layout. */
.hero {
  display: grid;
  gap: var(--s-4);
  padding: var(--s-5) 0 var(--s-6);
}

/* The circular portrait. Its green ring is the SVG inside, which
   draws itself around the photo once on load. */
.shot {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  width: min(11rem, 55%);
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 50%;
  background: var(--tint-1);
}

.ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);   /* the sweep starts at 12 o'clock */
}

.ring circle {
  fill: none;
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.ring-base {
  stroke: var(--rule);
}

.ring-draw {
  stroke: var(--accent);
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: ring-sweep 1000ms cubic-bezier(0.4, 0, 0.2, 1) 200ms forwards;
}

@keyframes ring-sweep {
  to { stroke-dashoffset: 0; }
}

/* The original photo, filling the frame. */
.portrait {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 18%;
}

/* Heading, then subheading. */
.name {
  font-size: var(--t-hero);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.035em;
}

.tagline {
  margin: var(--s-2) 0 0;
  font-size: clamp(1.125rem, 3.4vw, 1.5rem);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.015em;
  color: var(--accent-ink);
}

.sub {
  margin: var(--s-4) 0 0;
  max-width: 46ch;
  color: var(--muted);
}

.sub a {
  color: var(--accent-ink);
}

.sub a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Previously: the logos carry it, the names sit beside them. */
.prev {
  margin-top: var(--s-5);
}

.prev-label {
  margin: 0 0 var(--s-3);
  font-family: var(--mono);
  font-size: var(--t-micro);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.prev-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
}

.prev-item {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  padding: var(--s-1) var(--s-3) var(--s-1) var(--s-2);
  border-radius: 999px;
  background: var(--tint-1);
  font-size: var(--t-small);
  font-weight: 600;
  letter-spacing: -0.01em;
}

.prev-logo {
  width: 1.375rem;
  height: 1.375rem;
  border-radius: 6px;
}

.prev-note {
  margin: var(--s-3) 0 0;
  font-size: var(--t-small);
  color: var(--muted);
}

/* The metrics, each on a green rule. Stacked on phones; the
   760px query puts them in a row. */
.metrics {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-4);
  margin-top: var(--s-5);
  max-width: 30rem;
}

.metric {
  padding-left: var(--s-3);
  border-left: 3px solid var(--accent);
}

.metric-num {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.025em;
}

.metric-label {
  display: block;
  margin-top: var(--s-1);
  font-size: var(--t-small);
  line-height: 1.45;
  color: var(--muted);
}

/* ---------- 5. Links -------------------------------------- */

.section {
  padding-bottom: var(--s-6);
}

/* Auto-fits however many links are in data.js. */
.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: var(--s-2);
  max-width: 26rem;
}

.tile {
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  min-height: 56px;
  border-radius: 14px;
  background: var(--tint-1);
  transition: transform 180ms ease, background-color 180ms ease;
}

.tile:hover,
.tile:focus-visible {
  transform: translateY(-3px);
  background: var(--accent);
}

/* Pressing feels pressed. */
.tile:active {
  transform: scale(0.95);
  transition-duration: 90ms;
}

.icon {
  width: 24px;
  height: 24px;
  fill: var(--ink);
  transition: fill 180ms ease;
}

.tile:hover .icon,
.tile:focus-visible .icon {
  fill: var(--ground);
}

/* ---------- 6. Tools -------------------------------------- */

.stack {
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
}

.stage-label {
  margin: 0 0 var(--s-2);
  font-family: var(--mono);
  font-size: var(--t-micro);
  color: var(--accent-ink);
}

/* The arrow between stages: chips become a pipeline. Row layout
   only, so it appears at 760px. */
.stage-sep {
  display: none;
  align-self: center;
  color: var(--muted);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
}

.chip {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  padding: var(--s-2) var(--s-3);
  border-radius: 999px;
  background: var(--tint-2);
  font-size: var(--t-small);
  transition: transform 120ms ease;
}

.chip:active {
  transform: scale(0.95);
}

/* The green bloom that ripples out from where a tile or chip was
   pressed. script.js drops one in at the contact point. */
.bloom {
  position: absolute;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 30%, transparent);
  transform: translate(-50%, -50%) scale(0);
  animation: bloom 450ms ease-out forwards;
  pointer-events: none;
}

@keyframes bloom {
  to {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0;
  }
}

.chip .icon {
  width: 18px;
  height: 18px;
}

/* The paragraph of actual voice on the page — full ink, bound to
   its own section rather than floating between two. */
.caption {
  margin: var(--s-4) 0 0;
  color: var(--ink);
}

.caption a {
  color: var(--accent-ink);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent);
}

.caption a:hover {
  text-decoration-color: var(--accent);
}


/* ---------- 7. Work cards --------------------------------- */

.cards {
  display: grid;
  gap: var(--s-4);
}

.card {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  height: 100%;
  padding: var(--s-4);
  border-radius: var(--radius);
  background: var(--tint-1);
  transition: transform 200ms ease;
}

/* Tints cycle so no two neighbouring cards match. */
.cards > li:nth-child(4n + 2) .card { background: var(--tint-2); }
.cards > li:nth-child(4n + 3) .card { background: var(--tint-3); }
.cards > li:nth-child(4n + 4) .card { background: var(--tint-4); }

.card:hover,
.card:focus-visible {
  transform: translateY(-4px);
}

.card-kind {
  font-family: var(--mono);
  font-size: var(--t-micro);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Regular, not 500: the system serifs ship regular and bold only,
   and a synthesised weight shows at this size. */
.card-title {
  font-family: var(--serif);
  font-size: var(--t-card);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.card-note {
  color: var(--muted);
  font-size: var(--t-small);
}

/* Where the link actually goes, rather than a "click here". */
.card-go {
  margin-top: auto;
  padding-top: var(--s-4);
  font-family: var(--mono);
  font-size: var(--t-micro);
  letter-spacing: 0.08em;
  color: var(--accent-ink);
}

.arrow {
  display: inline-block;
  transition: transform 180ms ease;
}

.card:hover .arrow {
  transform: translateX(4px);
}

/* ---------- 8. Footer ------------------------------------- */

.foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--s-2);
  padding-top: var(--s-4);
  border-top: 1px solid var(--rule);
  font-size: var(--t-small);
  color: var(--muted);
}


/* ---------- 8b. Phones — everything centred --------------- */

/* On a phone the column is narrow enough that centring reads as
   composed rather than adrift. Desktop stays left-aligned. */
@media (max-width: 759px) {
  main,
  .foot {
    text-align: center;
  }

  .shot {
    margin-inline: auto;
  }

  /* Hairlines on both sides of the label instead of just the right. */
  .label {
    justify-content: center;
  }

  .label::before {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--rule);
  }

  .sub,
  .prev-note,
  .caption,
  .tiles {
    margin-inline: auto;
  }

  .prev-list,
  .chips {
    justify-content: center;
  }

  /* Two footer lines, stacked, rather than an odd gap between them. */
  .foot {
    flex-direction: column;
    align-items: center;
    gap: var(--s-1);
  }

  /* The green rule moves above the number so the text can centre —
     a short tick, not an edge-to-edge bar, which read as heavy
     stripes at full viewport width. */
  .metrics {
    max-width: none;
  }

  .metric {
    padding-left: 0;
    border-left: 0;
  }

  .metric::before {
    content: "";
    display: block;
    width: 2.25rem;
    height: 3px;
    margin: 0 auto var(--s-2);
    border-radius: 999px;
    background: var(--accent);
  }

  .card {
    align-items: center;
  }
}

/* ---------- 9. 760px — two up ----------------------------- */

@media (min-width: 760px) {
  .page {
    padding: var(--s-4) var(--s-5) var(--s-6);
  }

  /* Text left, portrait right, as in the reference. */
  .hero {
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
    align-items: center;
    gap: var(--s-6);
    padding: var(--s-6) 0;
  }

  .hero-text {
    order: -1;
  }

  .shot {
    width: min(16rem, 100%);
    margin-left: auto;
  }

  .metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    max-width: 38rem;
  }

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

  /* An odd number of cards would leave a visible empty slot, so the
     last one closes the row instead. */
  .cards > li:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }

  .cards > li:last-child:nth-child(odd) .card-note {
    max-width: 60ch;
  }

  .card {
    padding: var(--s-5);
  }

  .tiles {
    grid-template-columns: repeat(5, 84px);
    gap: var(--s-3);
  }

  .stack {
    flex-direction: row;
    gap: var(--s-4);
  }

  .stage-sep {
    display: block;
  }
}

/* ---------- 10. 1100px — wide ---------------------------- */

@media (min-width: 1100px) {
  .hero {
    gap: 5rem;
    padding: 5rem 0 var(--s-6);
  }

  .card {
    padding: var(--s-6) var(--s-5);
  }
}

/* ---------- 11. Reduced motion --------------------------- */

@media (prefers-reduced-motion: reduce) {
  * {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
