/* ============================================================
   Arvind Kannan — Portfolio styles
   Fluid · accessible · light/dark/system · print-ready
   ============================================================ */

:root {
  color-scheme: light dark;

  --brand-1: #6366f1;
  --brand-2: #06b6d4;
  --brand-3: #a855f7;

  --bg: #f6f7fb;
  --bg-elev: #ffffff;
  --surface: rgba(255, 255, 255, 0.72);
  --surface-strong: #ffffff;
  --text: #0b1020;
  --text-muted: #4b5563;
  --text-subtle: #6b7280;
  --border: rgba(15, 23, 42, 0.08);
  --border-strong: rgba(15, 23, 42, 0.14);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06), 0 1px 1px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 10px 30px -12px rgba(15, 23, 42, 0.18);
  --shadow-lg: 0 30px 60px -20px rgba(15, 23, 42, 0.25);
  --ring: 0 0 0 3px rgba(99, 102, 241, 0.35);

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-pill: 999px;

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

  --step--1: clamp(0.82rem, 0.78rem + 0.2vw, 0.92rem);
  --step-0:  clamp(0.95rem, 0.9rem + 0.25vw, 1.05rem);
  --step-1:  clamp(1.1rem, 1rem + 0.5vw, 1.3rem);
  --step-2:  clamp(1.35rem, 1.2rem + 0.8vw, 1.7rem);
  --step-3:  clamp(1.7rem, 1.4rem + 1.4vw, 2.4rem);
  --step-4:  clamp(2.2rem, 1.7rem + 2.4vw, 3.4rem);
  --step-5:  clamp(2.8rem, 2rem + 3.6vw, 4.6rem);

  --container: 1140px;
}

html[data-theme="dark"],
html[data-theme="system"][data-system="dark"] {
  --bg: #0a0e1a;
  --bg-elev: #0f1424;
  --surface: rgba(20, 26, 46, 0.6);
  --surface-strong: #141a2e;
  --text: #e6e9f2;
  --text-muted: #a8b0c2;
  --text-subtle: #8089a0;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 10px 30px -12px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 30px 60px -20px rgba(0, 0, 0, 0.7);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
html, body { overflow-x: clip; max-width: 100%; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--step-0);
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-wrap: break-word;
  word-wrap: break-word;
}
h1, h2, h3, h4, p, li, a, summary { overflow-wrap: anywhere; word-break: break-word; hyphens: auto; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 6px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--brand-1); color: white; padding: 10px 14px;
  border-radius: 0 0 10px 0; z-index: 1000;
}
.skip-link:focus { left: 0; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 clamp(16px, 4vw, 28px); }
.section { padding: clamp(56px, 8vw, 110px) 0; }
.section-head { max-width: 760px; margin: 0 0 32px; }
.section-head h2 { font-size: var(--step-3); margin: 6px 0 8px; letter-spacing: -0.02em; }
.section-head .sub { color: var(--text-muted); margin: 0; }
.kicker {
  font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--text-subtle); margin: 0;
}

.two-col {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: clamp(20px, 4vw, 48px);
  align-items: start;
}
@media (max-width: 820px) { .two-col { grid-template-columns: 1fr; } }

.grid { display: grid; gap: clamp(14px, 2vw, 22px); }
.cards { grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); }

/* Header / Nav */
.site-header {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  background: color-mix(in oklab, var(--bg) 78%, transparent);
  border-bottom: 1px solid var(--border);
}
.nav-wrap { display: flex; align-items: center; justify-content: space-between; gap: 18px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -0.01em; }
.brand-mark {
  display: inline-grid; place-items: center;
  width: 30px; height: 30px; border-radius: 9px;
  background: linear-gradient(135deg, var(--brand-1), var(--brand-3));
  color: white; font-size: 12px; font-weight: 800;
  box-shadow: var(--shadow-sm);
}
.nav { display: flex; gap: 4px; flex: 1; justify-content: center; }
.nav a {
  padding: 8px 12px; border-radius: var(--radius-pill);
  color: var(--text-muted); font-weight: 500; font-size: 0.92rem;
  transition: color .2s ease, background .2s ease;
}
.nav a:hover, .nav a.is-active { color: var(--text); background: var(--border); }
@media (max-width: 900px) { .nav { display: none; } }

.nav-actions { display: flex; align-items: center; gap: 10px; }
.theme-switch {
  display: inline-flex; padding: 4px; border: 1px solid var(--border);
  border-radius: var(--radius-pill); background: var(--surface);
}
.theme-switch button {
  display: inline-grid; place-items: center;
  width: 30px; height: 30px; border-radius: var(--radius-pill);
  color: var(--text-muted);
}
.theme-switch button svg { width: 16px; height: 16px; }
.theme-switch button[aria-pressed="true"] {
  background: linear-gradient(135deg, var(--brand-1), var(--brand-3));
  color: white; box-shadow: var(--shadow-sm);
}

.menu-toggle {
  display: none;
  width: 38px; height: 38px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface);
  position: relative;
}
.menu-toggle span {
  position: absolute; left: 9px; right: 9px; height: 2px; background: currentColor;
  transition: transform .2s ease, opacity .2s ease, top .2s ease;
}
.menu-toggle span:nth-child(1) { top: 12px; }
.menu-toggle span:nth-child(2) { top: 18px; }
.menu-toggle span:nth-child(3) { top: 24px; }
.menu-toggle[aria-expanded="true"] span:nth-child(1) { top: 18px; transform: rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] span:nth-child(3) { top: 18px; transform: rotate(-45deg); }
@media (max-width: 900px) { .menu-toggle { display: inline-block; } }

.mobile-nav {
  display: none;
  flex-direction: column; gap: 4px;
  padding: 12px clamp(16px, 4vw, 28px) 18px;
  border-top: 1px solid var(--border);
  background: var(--bg-elev);
}
.mobile-nav a { padding: 12px 10px; border-radius: 10px; color: var(--text-muted); font-weight: 500; }
.mobile-nav a:hover { color: var(--text); background: var(--border); }
.mobile-nav.is-open { display: flex; }

/* Hero */
.hero { position: relative; overflow: hidden; padding: clamp(70px, 12vw, 140px) 0 clamp(40px, 6vw, 80px); }
.hero-bg { position: absolute; inset: 0; pointer-events: none; }
.orb { position: absolute; border-radius: 50%; filter: blur(70px); opacity: 0.55; will-change: transform; }
.orb-a {
  width: 520px; height: 520px; left: -120px; top: -120px;
  background: radial-gradient(circle, var(--brand-1), transparent 60%);
  animation: float 14s ease-in-out infinite alternate;
}
.orb-b {
  width: 460px; height: 460px; right: -120px; top: 60px;
  background: radial-gradient(circle, var(--brand-2), transparent 60%);
  animation: float 18s ease-in-out infinite alternate-reverse;
}
.grid-overlay {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(to right, var(--border) 1px, transparent 1px),
    linear-gradient(to bottom, var(--border) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse at 50% 30%, black, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 30%, black, transparent 70%);
  opacity: 0.45;
}
@keyframes float {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(30px, 20px, 0) scale(1.08); }
}

.hero-inner { position: relative; max-width: 920px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: var(--radius-pill);
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text-muted); font-size: 0.85rem; font-weight: 500;
  margin: 0 0 18px;
}
.eyebrow .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #22c55e; box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.18);
}
.hero-title {
  font-size: var(--step-5);
  line-height: 1.05; letter-spacing: -0.03em;
  margin: 0 0 18px; font-weight: 800;
  overflow-wrap: anywhere;
  hyphens: auto;
}
.grad {
  background: linear-gradient(120deg, var(--brand-1), var(--brand-2) 60%, var(--brand-3));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lead { font-size: var(--step-1); color: var(--text-muted); max-width: 760px; margin: 0 0 28px; }
.hero-stats {
  list-style: none; padding: 0; margin: 0 0 28px;
  display: flex; flex-wrap: wrap; gap: clamp(16px, 4vw, 36px);
}
.hero-stats li { display: flex; flex-direction: column; gap: 2px; }
.hero-stats strong {
  font-size: var(--step-3); font-weight: 800; letter-spacing: -0.02em;
  background: linear-gradient(120deg, var(--brand-1), var(--brand-3));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-stats span { font-size: 0.85rem; color: var(--text-subtle); }

.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 30px; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 18px; border-radius: var(--radius-pill);
  font-weight: 600; font-size: 0.95rem;
  border: 1px solid var(--border-strong);
  background: var(--surface-strong);
  color: var(--text);
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease;
  box-shadow: var(--shadow-sm);
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn.primary {
  background: linear-gradient(135deg, var(--brand-1), var(--brand-3));
  color: white; border-color: transparent;
}
.btn.primary:hover { box-shadow: 0 14px 30px -10px color-mix(in oklab, var(--brand-1) 60%, transparent); }
.btn.ghost { background: var(--surface); }

.social-row {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-wrap: wrap; gap: 8px;
}
.social-row a {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: var(--radius-pill);
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text-muted); font-size: 0.88rem; font-weight: 500;
  transition: color .2s ease, border-color .2s ease, transform .15s ease;
}
.social-row a:hover { color: var(--text); border-color: var(--border-strong); transform: translateY(-1px); }
.social-row svg { width: 16px; height: 16px; }

/* Cards */
.card {
  background: var(--surface-strong);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: clamp(18px, 2.2vw, 26px);
  box-shadow: var(--shadow-sm);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.card h3 { margin: 0 0 8px; font-size: var(--step-1); letter-spacing: -0.01em; }
.card p { margin: 0; color: var(--text-muted); }
.cards .card:hover, .timeline-item.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}

.profile-card { position: sticky; top: 88px; }
.profile-card h3 { margin-bottom: 14px; }
.bullets { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.bullets li {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px;
  padding: 10px 0; border-bottom: 1px dashed var(--border);
  font-size: 0.93rem;
}
.bullets li:last-child { border-bottom: 0; }
.bullets span { color: var(--text-subtle); }

.prose p { color: var(--text-muted); margin: 0 0 14px; font-size: var(--step-1); }
.prose strong { color: var(--text); }

/* Timeline */
.timeline { list-style: none; padding: 0; margin: 0; display: grid; gap: 16px; position: relative; }
.timeline-item.card {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
.timeline-item > .content { min-width: 0; }
.timeline-item .time {
  font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--text-subtle);
  padding: 6px 10px; border: 1px dashed var(--border-strong);
  border-radius: var(--radius-pill);
  align-self: start; justify-self: start;
  background: var(--surface);
  white-space: nowrap;
}
.timeline-item .role { color: var(--text-subtle); margin: 4px 0 10px; font-size: 0.9rem; }
.timeline-item h3 { margin: 0; }
.timeline-item h4 { margin: 0 0 6px; font-size: 1rem; color: var(--text); font-weight: 600; }

.work-detail { margin-top: 12px; border-top: 1px solid var(--border); padding-top: 12px; }
.work-detail summary {
  cursor: pointer; font-weight: 600; color: var(--text);
  list-style: none; display: inline-flex; align-items: center; gap: 6px;
}
.work-detail summary::-webkit-details-marker { display: none; }
.work-detail summary::after { content: "▾"; transition: transform .2s ease; }
.work-detail[open] summary::after { transform: rotate(180deg); }
.work-detail ul { margin: 10px 0 0; padding-left: 18px; color: var(--text-muted); }

@media (max-width: 640px) {
  .timeline-item.card { grid-template-columns: minmax(0, 1fr); }
}

/* Detailed achievement list inside expandable work-detail */
.achievements {
  margin: 10px 0 0; padding-left: 20px; color: var(--text-muted);
  display: grid; gap: 6px;
}
.achievements li { line-height: 1.55; }
.achievements li::marker { color: var(--brand-1); }

/* Skills */
.skill { display: flex; flex-direction: column; gap: 6px; }
.skill-icon {
  width: 42px; height: 42px; border-radius: 12px;
  display: grid; place-items: center; font-size: 22px;
  background: linear-gradient(135deg, color-mix(in oklab, var(--brand-1) 18%, transparent), color-mix(in oklab, var(--brand-2) 18%, transparent));
  border: 1px solid var(--border);
  margin-bottom: 8px;
}

/* Work / link cards */
.work-card .tag, .link-card .tag {
  display: inline-block;
  font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--text-subtle);
  padding: 4px 10px; border-radius: var(--radius-pill);
  background: var(--surface); border: 1px solid var(--border);
  margin-bottom: 10px;
}
.work-card.placeholder { border-style: dashed; background: transparent; }

.link-card { position: relative; padding-right: 60px; }
.link-card .arrow {
  position: absolute; right: 18px; bottom: 18px;
  width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text); font-weight: 700;
  transition: transform .2s ease, background .2s ease, color .2s ease;
}
.link-card:hover .arrow {
  background: linear-gradient(135deg, var(--brand-1), var(--brand-3));
  color: white; transform: translateX(4px);
}

/* Contact */
.contact-card {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 24px; min-width: 0;
  background:
    radial-gradient(circle at 0% 0%, color-mix(in oklab, var(--brand-1) 20%, transparent), transparent 50%),
    radial-gradient(circle at 100% 100%, color-mix(in oklab, var(--brand-2) 20%, transparent), transparent 50%),
    var(--surface-strong);
  padding: clamp(24px, 4vw, 44px);
  border-radius: var(--radius-lg);
}
.contact-card h2 { margin: 4px 0 6px; font-size: var(--step-3); letter-spacing: -0.02em; }
.contact-actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 22px 0 32px;
  color: var(--text-subtle);
  font-size: 0.9rem;
}
.footer-wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; }
.footer-social { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 14px; }
.footer-social a:hover { color: var(--text); }

/* Reveal */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
.reveal.is-visible { opacity: 1; transform: none; }

/* Print */
@media print {
  .site-header, .site-footer, .hero-bg, .menu-toggle, .theme-switch,
  .nav-actions, .mobile-nav, .hero-cta, .social-row, .contact-actions { display: none !important; }
  body { background: #fff !important; color: #000 !important; }
  .card { box-shadow: none !important; border: 1px solid #ddd !important; background: #fff !important; }
  .section { padding: 16px 0 !important; page-break-inside: avoid; }
  .hero { padding: 16px 0 !important; }
  .hero-title { font-size: 28px !important; }
  a { color: #000 !important; text-decoration: underline; }
  .grad { color: #000 !important; -webkit-text-fill-color: #000 !important; }
}
