/* supratik.org */

:root {
  --bg: #fcfcfc;
  --text: #4a515b;
  --strong: #1e2125;
  --faint: #6e747e; /* dates/meta — kept at >=4.5:1 on --bg for WCAG AA */
  --rule: rgba(0, 0, 0, 0.08);
  --hover: rgba(0, 0, 0, 0.028);

  /* Accent used for link underlines, the tab indicator, and the ↗ arrows.
     Same in both themes — it's a brand colour, not a surface colour. */
  --accent: #c9a0dc;
  --accent-soft: rgba(201, 160, 220, 0.45);

  /* Experience layout: a fixed left column so every divider lands on the
     same x, and one gutter value used on both sides of the rule. */
  --company-col: 11.5rem;
  --gutter: 1rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101012;
    --text: #9ca1aa;
    --strong: #ededef;
    --faint: #8b919b;
    --rule: rgba(255, 255, 255, 0.10);
    --hover: rgba(255, 255, 255, 0.035);
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI',
               Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'kern' 1;

  /* Lowercase is a display choice only — the HTML keeps real capitalisation
     so screen readers, search engines, and copy-paste get "Medal.tv", not
     "medal.tv". Delete this one line to go back to normal casing. */
  text-transform: lowercase;
}

main {
  max-width: 40rem;
  margin: 0 auto;
  padding: clamp(4rem, 14vh, 8rem) 1.5rem 4rem;
}

/* ── type ──────────────────────────────────────────────── */

h1, h2 {
  margin: 0;
  font-size: 1em;
  font-weight: 600;
  color: var(--strong);
  letter-spacing: -0.005em;
}

p { margin: 0 0 1.05em; }
p:last-child { margin-bottom: 0; }

a {
  color: var(--strong);
  text-decoration: none;
  border-bottom: 1px solid var(--accent-soft);
  transition: border-color .18s ease, color .18s ease;
}
a:hover { border-bottom-color: var(--accent); }

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

/* ── header ────────────────────────────────────────────── */

.intro { margin-bottom: 1.75rem; }

/* ── tabs ──────────────────────────────────────────────── */

nav {
  position: relative; /* the underline positions against this */
  display: flex;
  gap: 1.5rem;
  padding-bottom: .625rem;
  margin-bottom: 2.25rem;
  border-bottom: 1px solid var(--rule);
}

nav a {
  border-bottom: none; /* cancel the global link rule */
  color: var(--faint);
  transition: color .18s ease;
}

/* Active state changes colour ONLY. Anything that alters the box —
   font-weight, size, padding — would shift the geometry the underline
   is measured from. */
nav a.active { color: var(--strong); }
nav a:hover { color: var(--strong); }

.underline {
  position: absolute;
  bottom: -1px;      /* sits on top of the nav's bottom rule */
  left: 0;
  width: 0;
  height: 1px;
  background: var(--accent);
  /* left/width and the transition are set inline by tabs.js */
}

/* ── panels ────────────────────────────────────────────── */

.panel { min-height: 11rem; } /* keeps the footer from jumping between tabs */
.panel:focus { outline: none; }
[hidden] { display: none !important; }

/* ── row lists (experience + contact) ──────────────────── */

.rows {
  list-style: none;
  margin: 0;
  padding: 0;
}

.rows li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
  padding: .5rem .5rem .5rem .625rem;
  margin: 0 -.5rem 0 -.625rem;
  border-radius: 5px;
  transition: background-color .18s ease;
}

/* Hover highlights individual roles, never a whole group. */
.rows > li:not(.group):hover,
.sub > li:hover { background-color: var(--hover); }

/* ── grouped employer (both Medal tv roles) ────────────── */

/* Two columns either side of a shared divider: the company right-aligned
   and vertically centred in column 1, its roles in column 2. Selector is
   `.rows > li.group` so it outranks `.rows li` (which sets display:flex). */
.rows > li.group {
  display: grid;
  grid-template-columns: var(--company-col) 1fr;
  align-items: center; /* centres the company against its roles block */
  /* Must reset: `.rows li` sets gap:1.5rem for the flex rows, which grid
     would apply as a column gap and widen the left gutter by 24px. */
  gap: 0;
  padding: .375rem 0;
  margin: 0;
}

.parent {
  color: var(--strong);
  text-align: right; /* every company name ends on the divider */
  padding-right: var(--gutter);
}

.sub {
  list-style: none;
  margin: 0;
  padding-left: var(--gutter); /* same gutter both sides of the rule */
  border-left: 1px solid var(--rule);
}

/* The negative margin is smaller than the gutter, so the hover highlight
   starts inside the gutter and never crosses the divider. */
.sub > li {
  padding: .3125rem .5rem;
  margin: 0 -.5rem;
}

/* Role is the SECONDARY line — the company above it is primary. */
.what {
  color: var(--text);
  text-wrap: pretty;
}

.when {
  flex: none;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
  font-size: .9375em;
}

/* Company links: primary weight, and visibly clickable at rest — a standing
   underline plus an outbound arrow, both of which strengthen on hover. */
.parent a {
  color: var(--strong);
  border-bottom: none; /* using text-decoration so the arrow can opt out */
  text-decoration: underline;
  text-decoration-color: var(--accent-soft);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: text-decoration-color .18s ease;
}

.parent a:hover,
.parent a:focus-visible {
  text-decoration-color: var(--accent);
}

.parent a::after {
  content: '↗';
  display: inline-block; /* keeps the arrow out of the underline */
  margin-left: .25em;
  font-size: .8em;
  color: var(--accent);
  opacity: .7;
  transition: opacity .18s ease, transform .18s ease;
}

.parent a:hover::after,
.parent a:focus-visible::after {
  opacity: 1;
  transform: translate(1px, -1px);
}

/* ── footer ────────────────────────────────────────────── */

footer {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: .5rem 1.5rem;
  margin-top: 5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  color: var(--faint);
  font-size: .875em;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-links a {
  color: var(--faint);
  border-bottom-color: transparent;
}
.footer-links a:hover {
  color: var(--strong);
  border-bottom-color: var(--accent);
}

/* ── quiet entrance ────────────────────────────────────── */

.intro,
section,
footer {
  animation: rise .6s cubic-bezier(.22, 1, .36, 1) backwards;
}
.intro         { animation-delay: .02s; }
#about         { animation-delay: .08s; }
#experience    { animation-delay: .14s; }
#contact       { animation-delay: .20s; }
footer         { animation-delay: .26s; }

@keyframes rise {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

/* ── small screens ─────────────────────────────────────── */

@media (max-width: 34rem) {
  .rows li {
    flex-direction: column;
    align-items: flex-start;
    gap: .0625rem;
  }
  .when { font-size: .875em; }

  /* A fixed 11.5rem column would leave almost nothing for the role text
     here, so drop the two-column split and stack company over roles. */
  .rows > li.group {
    display: block;
    padding: .5rem 0;
  }
  .parent {
    display: block;
    text-align: left;
    padding-right: 0;
    margin-bottom: .1875rem;
  }
  .sub { padding-left: .5rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
  }
}
