/* ==========================================================================
   arunkumar.work
   Single stylesheet, no build step. Tokens first, then layout, then blocks.
   ========================================================================== */

:root {
  --bg:          #fbfaf9;
  --bg-raised:   #ffffff;
  --bg-sunken:   #f4f2f0;
  --text:        #1c1917;
  --text-muted:  #6b625c;
  --text-faint:  #948d87;
  --border:      #e5e1dd;
  --border-firm: #d6d1cb;
  --accent:      #0d7d72;
  --accent-soft: #e2f2ef;
  --shadow:      0 1px 2px rgba(28, 25, 23, .04), 0 8px 24px -12px rgba(28, 25, 23, .12);

  --max: 68rem;
  --gutter: clamp(1.25rem, 5vw, 3rem);

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

:root[data-theme="dark"] {
  --bg:          #0c0a09;
  --bg-raised:   #16130f;
  --bg-sunken:   #121010;
  --text:        #f5f1ed;
  --text-muted:  #a49c95;
  --text-faint:  #766e68;
  --border:      #2a2522;
  --border-firm: #3a332f;
  --accent:      #4ecdc0;
  --accent-soft: #10302d;
  --shadow:      0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px -12px rgba(0, 0, 0, .6);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:          #0c0a09;
    --bg-raised:   #16130f;
    --bg-sunken:   #121010;
    --text:        #f5f1ed;
    --text-muted:  #a49c95;
    --text-faint:  #766e68;
    --border:      #2a2522;
    --border-firm: #3a332f;
    --accent:      #4ecdc0;
    --accent-soft: #10302d;
    --shadow:      0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px -12px rgba(0, 0, 0, .6);
  }
}

/* --------------------------------------------------------------- baseline */

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { line-height: 1.2; margin: 0; letter-spacing: -0.02em; font-weight: 600; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
a { color: inherit; }
strong { font-weight: 600; color: var(--text); }

.skip {
  position: absolute; left: -9999px;
  background: var(--accent); color: #fff;
  padding: .75rem 1rem; border-radius: .5rem; z-index: 100;
}
.skip:focus { left: 1rem; top: 1rem; }

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

/* ----------------------------------------------------------------- topbar */

.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 1.5rem;
  padding: .9rem var(--gutter);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
@supports not (backdrop-filter: blur(1px)) { .topbar { background: var(--bg); } }
.topbar:hover { border-bottom-color: var(--border); }

.wordmark {
  display: inline-flex; align-items: center; gap: .6rem;
  text-decoration: none; font-weight: 600; margin-right: auto;
}
.wordmark-mark {
  display: grid; place-items: center;
  width: 1.85rem; height: 1.85rem; border-radius: .5rem;
  background: var(--accent); color: #fff;
  font-family: var(--mono); font-size: .7rem; font-weight: 500;
  letter-spacing: .02em;
}
.wordmark-text { font-size: .95rem; letter-spacing: -0.01em; }

.topbar nav { display: flex; gap: 1.5rem; }
.topbar nav a {
  text-decoration: none; font-size: .9rem; color: var(--text-muted);
  transition: color .15s;
}
.topbar nav a:hover { color: var(--text); }

.theme-toggle {
  display: grid; place-items: center;
  width: 2.1rem; height: 2.1rem; padding: 0;
  border: 1px solid var(--border); border-radius: .55rem;
  background: var(--bg-raised); color: var(--text-muted);
  cursor: pointer; transition: color .15s, border-color .15s;
}
.theme-toggle:hover { color: var(--text); border-color: var(--border-firm); }
.icon-moon { display: none; }
:root[data-theme="dark"] .icon-sun { display: none; }
:root[data-theme="dark"] .icon-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-sun { display: none; }
  :root:not([data-theme="light"]) .icon-moon { display: block; }
}
:root[data-theme="light"] .icon-sun { display: block; }
:root[data-theme="light"] .icon-moon { display: none; }

@media (max-width: 34rem) {
  .topbar nav { display: none; }
  .wordmark-text { display: none; }
}

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

.hero {
  padding: clamp(3.5rem, 11vw, 7rem) var(--gutter) clamp(2.5rem, 6vw, 4rem);
  position: relative; overflow: hidden;
}
.hero::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(52rem 28rem at 12% -12%,
      color-mix(in srgb, var(--accent) 11%, transparent), transparent 70%);
  pointer-events: none;
}
.hero-inner {
  max-width: var(--max); margin: 0 auto; position: relative;
  display: grid; gap: 2.25rem; justify-items: start;
}
/* Portrait sits above the text when stacked, beside it once there is room. */
.hero-portrait { order: -1; margin: 0; }
.hero-portrait img {
  display: block; border-radius: 50%; object-fit: cover;
  width: clamp(7.5rem, 22vw, 13rem); height: clamp(7.5rem, 22vw, 13rem);
  border: 1px solid var(--border); box-shadow: var(--shadow);
  background: var(--bg-sunken);
}
@media (min-width: 54rem) {
  .hero-inner {
    grid-template-columns: 1fr auto;
    align-items: center; gap: clamp(2rem, 6vw, 4.5rem);
  }
  .hero-portrait { order: 0; }
}

.eyebrow {
  font-family: var(--mono); font-size: .74rem; text-transform: uppercase;
  letter-spacing: .16em; color: var(--text-faint); margin-bottom: 1.1rem;
}

.hero h1 {
  font-size: clamp(2.9rem, 9vw, 4.75rem);
  letter-spacing: -0.045em; font-weight: 700;
}
.hero-role {
  font-size: clamp(1.05rem, 2.6vw, 1.3rem);
  color: var(--accent); font-weight: 500;
  margin-top: .55rem; letter-spacing: -0.01em;
}
.lede {
  margin-top: 1.6rem; max-width: 40rem;
  font-size: clamp(1.02rem, 2vw, 1.16rem);
  color: var(--text-muted); line-height: 1.7;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2.1rem; }

.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .68rem 1.15rem; border-radius: .6rem;
  border: 1px solid var(--border-firm); background: var(--bg-raised);
  font-size: .92rem; font-weight: 500; text-decoration: none;
  transition: transform .15s, border-color .15s, background .15s;
}
.btn:hover { transform: translateY(-1px); border-color: var(--text-faint); }
.btn-primary {
  background: var(--accent); border-color: var(--accent); color: #fff;
}
:root[data-theme="dark"] .btn-primary { color: #06201d; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .btn-primary { color: #06201d; }
}
.btn-primary:hover { border-color: var(--accent); filter: brightness(1.06); }
.btn-sm { padding: .5rem .9rem; font-size: .87rem; }

.links { display: flex; flex-wrap: wrap; gap: 1.4rem; margin-top: 2rem; }
.links a {
  display: inline-flex; align-items: center; gap: .45rem;
  font-size: .89rem; color: var(--text-muted); text-decoration: none;
  transition: color .15s;
}
.links a:hover { color: var(--accent); }

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

.metrics {
  max-width: var(--max); margin-inline: var(--gutter);
  display: grid; gap: 1px;
  /* The 1px gap shows the container background as separator lines, so the
     column count must always divide the four tiles evenly or a stray empty
     cell renders as a grey block. */
  grid-template-columns: 1fr;
  background: var(--border); border: 1px solid var(--border);
  border-radius: .9rem; overflow: hidden;
}
@media (min-width: 30rem) {
  .metrics { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 62rem) {
  .metrics { grid-template-columns: repeat(4, 1fr); }
}
@media (min-width: 74rem) {
  .metrics { margin-inline: auto; }
}
.metric {
  background: var(--bg-raised);
  padding: 1.5rem 1.35rem;
  display: flex; flex-direction: column; gap: .35rem;
}
.metric-value {
  font-family: var(--mono); font-size: 1.85rem; font-weight: 500;
  color: var(--accent); letter-spacing: -0.03em; line-height: 1.1;
}
.metric-label { font-size: .84rem; color: var(--text-muted); line-height: 1.5; }

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

.section {
  max-width: var(--max); margin: 0 auto;
  padding: clamp(3.5rem, 9vw, 6rem) var(--gutter) 0;
}
.section-head { margin-bottom: 2.4rem; }
.section-head h2 {
  font-size: clamp(1.6rem, 4vw, 2.1rem); letter-spacing: -0.03em;
}
.section-head p { margin-top: .6rem; color: var(--text-muted); max-width: 38rem; }

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

.projects-list { display: grid; gap: 1.25rem; }

/* Sticky topbar would otherwise cover the top of a jumped-to target. */
.section, .project[id] { scroll-margin-top: 5rem; }

.project {
  border: 1px solid var(--border); border-radius: 1rem;
  background: var(--bg-raised); box-shadow: var(--shadow);
  overflow: hidden;
}
.project-body { padding: clamp(1.5rem, 4vw, 2.25rem); }

.project-title-row {
  display: flex; align-items: center; gap: .85rem; flex-wrap: wrap;
}
.project-title-row h3 { font-size: 1.4rem; letter-spacing: -0.025em; }

.tag {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .22rem .6rem; border-radius: 999px;
  font-family: var(--mono); font-size: .68rem;
  text-transform: uppercase; letter-spacing: .08em;
}
.tag-locked {
  background: var(--accent-soft); color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
}

.project-org {
  font-family: var(--mono); font-size: .75rem;
  color: var(--text-faint); margin-top: .5rem;
}
.project-org a {
  color: inherit; text-decoration: none;
  border-bottom: 1px dotted var(--border-firm);
  transition: color .15s, border-color .15s;
}
.project-org a:hover { color: var(--accent); border-color: var(--accent); }

/* Cross-reference from an experience bullet to its project card. */
.xref {
  color: var(--text); text-decoration: none; font-weight: 500;
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  transition: color .15s, border-color .15s;
}
.xref:hover { color: var(--accent); border-color: var(--accent); }

.project-summary {
  margin-top: .9rem; color: var(--text-muted);
  max-width: 44rem; line-height: 1.7;
}
.project-summary em, .project-points em {
  font-style: normal; color: var(--text); font-weight: 500;
}

.project-points { margin-top: 1.3rem; display: grid; gap: .5rem; }
.project-points li {
  position: relative; padding-left: 1.4rem;
  font-size: .93rem; color: var(--text-muted);
}
.project-points li::before {
  content: ""; position: absolute; left: .3rem; top: .62em;
  width: .32rem; height: .32rem; border-radius: 50%;
  background: var(--accent);
}

.stack { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: 1.5rem; }
.stack li {
  font-family: var(--mono); font-size: .74rem;
  padding: .25rem .55rem; border-radius: .35rem;
  background: var(--bg-sunken); color: var(--text-muted);
  border: 1px solid var(--border);
}

.tag-live {
  background: var(--accent-soft); color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
}
.tag-live .dot {
  width: .4rem; height: .4rem; border-radius: 50%;
  background: currentColor;
}
.tag-press {
  background: var(--bg-sunken); color: var(--text-muted);
  border: 1px solid var(--border-firm);
}

.project-actions {
  margin-top: 1.75rem; padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: 1rem 1.5rem; flex-wrap: wrap;
}

/* When a card carries a button, a note and press links, the note gets its own
   row so the links do not sit awkwardly beside wrapped text. */
.project-actions:has(.press):has(.project-note) .project-note {
  flex-basis: 100%; max-width: none; order: 3;
}

.press { display: flex; flex-wrap: wrap; gap: 1.25rem; }
.press a {
  display: inline-flex; align-items: center; gap: .3rem;
  font-size: .85rem; color: var(--text-muted);
  text-decoration: none; border-bottom: 1px solid var(--border-firm);
  padding-bottom: 1px; transition: color .15s, border-color .15s;
}
.press a::after { content: "\2197"; font-size: .8em; opacity: .6; }
.press a:hover { color: var(--accent); border-color: var(--accent); }
.project-note { font-size: .84rem; color: var(--text-faint); max-width: 26rem; }


/* ------------------------------------------------------------------- work */

.job { margin-bottom: 3.25rem; }
.job-head {
  display: flex; align-items: baseline; gap: 1rem; flex-wrap: wrap;
  padding-bottom: .9rem; margin-bottom: 1.75rem;
  border-bottom: 1px solid var(--border);
}
.job-head h3 { font-size: 1.3rem; letter-spacing: -0.025em; }
.job-meta {
  font-family: var(--mono); font-size: .78rem; color: var(--text-faint);
  margin-left: auto;
}

.role { position: relative; padding-left: 1.6rem; padding-bottom: 2rem; }
.role::before {
  content: ""; position: absolute; left: 0; top: .55rem;
  width: .5rem; height: .5rem; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--accent);
}
.role::after {
  content: ""; position: absolute; left: .21rem; top: 1.3rem; bottom: 0;
  width: 1px; background: var(--border);
}
.role:last-child { padding-bottom: 0; }
.role:last-child::after { display: none; }

.role-head {
  display: flex; align-items: baseline; gap: 1rem; flex-wrap: wrap;
  margin-bottom: .85rem;
}
.role-head h4 { font-size: 1.02rem; }
.role-date {
  font-family: var(--mono); font-size: .76rem; color: var(--text-faint);
  margin-left: auto;
}

.role ul { display: grid; gap: .55rem; }
.role li {
  position: relative; padding-left: 1.15rem;
  font-size: .93rem; color: var(--text-muted); line-height: 1.65;
}
.role li::before {
  content: "—"; position: absolute; left: 0;
  color: var(--text-faint);
}

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

.skills {
  display: grid; gap: 2rem;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  margin-bottom: 3.5rem;
}
.skill-group h3 {
  font-family: var(--mono); font-size: .74rem; font-weight: 500;
  text-transform: uppercase; letter-spacing: .13em;
  color: var(--text-faint); margin-bottom: 1rem;
}
.skill-group ul { display: flex; flex-wrap: wrap; gap: .4rem; }
.skill-group li {
  font-size: .85rem; padding: .3rem .65rem; border-radius: .4rem;
  background: var(--bg-sunken); border: 1px solid var(--border);
}

.two-col {
  display: grid; gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
}
.panel {
  border: 1px solid var(--border); border-radius: .9rem;
  background: var(--bg-raised); padding: 1.6rem;
}
.panel > h3 {
  font-family: var(--mono); font-size: .74rem; font-weight: 500;
  text-transform: uppercase; letter-spacing: .13em;
  color: var(--text-faint); margin-bottom: 1.3rem;
}
.entry + .entry {
  margin-top: 1.2rem; padding-top: 1.2rem;
  border-top: 1px solid var(--border);
}
.entry-title { font-weight: 500; font-size: .97rem; }
.entry-sub {
  font-family: var(--mono); font-size: .77rem;
  color: var(--text-faint); margin-top: .3rem;
}
.entry-note { font-size: .86rem; color: var(--text-muted); margin-top: .35rem; }

/* ---------------------------------------------------------------- contact */

.contact {
  max-width: var(--max); margin: clamp(4rem, 10vw, 7rem) auto 0;
  padding: clamp(2.5rem, 6vw, 3.5rem) var(--gutter);
  text-align: center;
}
.contact h2 { font-size: clamp(1.7rem, 4.5vw, 2.3rem); letter-spacing: -0.03em; }
.contact p {
  margin: .9rem auto 0; max-width: 34rem; color: var(--text-muted);
}
.contact .hero-actions { justify-content: center; }

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

footer {
  max-width: var(--max); margin: clamp(3rem, 7vw, 5rem) auto 0;
  padding: 1.75rem var(--gutter) 2.5rem;
  border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  font-size: .82rem; color: var(--text-faint);
}
.colophon { font-family: var(--mono); font-size: .74rem; }
