/* Portfolio - theme tokens, motion */

:root {
  --ink: #0b1220;
  --ink-soft: #1e293b;
  --muted: #64748b;
  --paper: #f7f5f1;
  --paper-warm: #efece6;
  --surface: rgba(255, 255, 255, 0.55);
  --surface-solid: #ffffff;
  --accent: #0d9488;
  --accent-deep: #0f766e;
  --accent-soft: rgba(13, 148, 136, 0.12);
  --hover-bg: rgba(11, 18, 32, 0.035);
  --line: rgba(11, 18, 32, 0.1);
  --nav-bg: rgba(247, 245, 241, 0.82);
  --btn-fg: #f7f5f1;
  --hero-glow: rgba(13, 148, 136, 0.14);
  --hero-shade: rgba(15, 23, 42, 0.05);
  --font-display: "Plus Jakarta Sans", sans-serif;
  --font-body: "Source Sans 3", sans-serif;
  color-scheme: light;
}

html[data-theme="dark"] {
  --ink: #f1f5f9;
  --ink-soft: #cbd5e1;
  --muted: #94a3b8;
  --paper: #0b1220;
  --paper-warm: #111827;
  --surface: rgba(30, 41, 59, 0.45);
  --surface-solid: #151e2e;
  --hover-bg: rgba(255, 255, 255, 0.035);
  --line: rgba(148, 163, 184, 0.16);
  --nav-bg: rgba(11, 18, 32, 0.82);
  --btn-fg: #0b1220;
  color-scheme: dark;
}

/* Accent palettes (work with light + dark) */
html,
html[data-accent="teal"] {
  --accent: #0d9488;
  --accent-deep: #0f766e;
  --accent-soft: rgba(13, 148, 136, 0.12);
  --hero-glow: rgba(13, 148, 136, 0.14);
  --hero-shade: rgba(15, 23, 42, 0.05);
  --accent-on: #042f2e;
}

html[data-theme="dark"],
html[data-theme="dark"][data-accent="teal"] {
  --accent: #2dd4bf;
  --accent-deep: #5eead4;
  --accent-soft: rgba(45, 212, 191, 0.12);
  --hero-glow: rgba(45, 212, 191, 0.1);
  --hero-shade: rgba(45, 212, 191, 0.04);
  --accent-on: #042f2e;
}

html[data-accent="ocean"] {
  --accent: #2563eb;
  --accent-deep: #1d4ed8;
  --accent-soft: rgba(37, 99, 235, 0.12);
  --hero-glow: rgba(37, 99, 235, 0.14);
  --hero-shade: rgba(15, 23, 42, 0.05);
  --accent-on: #eff6ff;
}

html[data-theme="dark"][data-accent="ocean"] {
  --accent: #60a5fa;
  --accent-deep: #93c5fd;
  --accent-soft: rgba(96, 165, 250, 0.14);
  --hero-glow: rgba(96, 165, 250, 0.12);
  --hero-shade: rgba(96, 165, 250, 0.04);
  --accent-on: #0f172a;
}

html[data-accent="coral"] {
  --accent: #e11d48;
  --accent-deep: #be123c;
  --accent-soft: rgba(225, 29, 72, 0.12);
  --hero-glow: rgba(225, 29, 72, 0.12);
  --hero-shade: rgba(15, 23, 42, 0.05);
  --accent-on: #fff1f2;
}

html[data-theme="dark"][data-accent="coral"] {
  --accent: #fb7185;
  --accent-deep: #fda4af;
  --accent-soft: rgba(251, 113, 133, 0.14);
  --hero-glow: rgba(251, 113, 133, 0.12);
  --hero-shade: rgba(251, 113, 133, 0.04);
  --accent-on: #1c1917;
}

html[data-accent="violet"] {
  --accent: #7c3aed;
  --accent-deep: #6d28d9;
  --accent-soft: rgba(124, 58, 237, 0.12);
  --hero-glow: rgba(124, 58, 237, 0.12);
  --hero-shade: rgba(15, 23, 42, 0.05);
  --accent-on: #f5f3ff;
}

html[data-theme="dark"][data-accent="violet"] {
  --accent: #a78bfa;
  --accent-deep: #c4b5fd;
  --accent-soft: rgba(167, 139, 250, 0.14);
  --hero-glow: rgba(167, 139, 250, 0.12);
  --hero-shade: rgba(167, 139, 250, 0.04);
  --accent-on: #1e1b4b;
}

html[data-accent="amber"] {
  --accent: #d97706;
  --accent-deep: #b45309;
  --accent-soft: rgba(217, 119, 6, 0.14);
  --hero-glow: rgba(217, 119, 6, 0.14);
  --hero-shade: rgba(15, 23, 42, 0.05);
  --accent-on: #fffbeb;
}

html[data-theme="dark"][data-accent="amber"] {
  --accent: #fbbf24;
  --accent-deep: #fcd34d;
  --accent-soft: rgba(251, 191, 36, 0.14);
  --hero-glow: rgba(251, 191, 36, 0.12);
  --hero-shade: rgba(251, 191, 36, 0.04);
  --accent-on: #1c1917;
}

html[data-accent="lime"] {
  --accent: #65a30d;
  --accent-deep: #4d7c0f;
  --accent-soft: rgba(101, 163, 13, 0.14);
  --hero-glow: rgba(101, 163, 13, 0.14);
  --hero-shade: rgba(15, 23, 42, 0.05);
  --accent-on: #f7fee7;
}

html[data-theme="dark"][data-accent="lime"] {
  --accent: #a3e635;
  --accent-deep: #bef264;
  --accent-soft: rgba(163, 230, 53, 0.14);
  --hero-glow: rgba(163, 230, 53, 0.12);
  --hero-shade: rgba(163, 230, 53, 0.04);
  --accent-on: #14532d;
}

html[data-accent="rose"] {
  --accent: #db2777;
  --accent-deep: #be185d;
  --accent-soft: rgba(219, 39, 119, 0.12);
  --hero-glow: rgba(219, 39, 119, 0.12);
  --hero-shade: rgba(15, 23, 42, 0.05);
  --accent-on: #fdf2f8;
}

html[data-theme="dark"][data-accent="rose"] {
  --accent: #f472b6;
  --accent-deep: #f9a8d4;
  --accent-soft: rgba(244, 114, 182, 0.14);
  --hero-glow: rgba(244, 114, 182, 0.12);
  --hero-shade: rgba(244, 114, 182, 0.04);
  --accent-on: #1c1917;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    radial-gradient(ellipse 80% 50% at 8% -8%, var(--hero-glow), transparent 55%),
    radial-gradient(ellipse 55% 40% at 92% 8%, var(--hero-shade), transparent 50%),
    linear-gradient(180deg, var(--paper) 0%, var(--paper-warm) 100%);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: rgba(13, 148, 136, 0.28);
  color: var(--ink);
}

.text-muted {
  color: var(--muted);
}

.text-body {
  color: var(--ink-soft);
}

.text-ink {
  color: var(--ink);
}

.text-accent {
  color: var(--accent);
}

/* ----- Nav ----- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: var(--nav-bg);
  border-bottom: 1px solid var(--line);
  transition: background 0.25s ease, border-color 0.25s ease;
}

.nav-brand {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-link {
  position: relative;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

.nav-link:hover,
.nav-link.is-active {
  color: var(--ink);
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 100%;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}

.nav-link.is-active::after {
  transform: scaleX(1);
}

/* Floating theme dock */
.theme-dock {
  position: fixed;
  right: 1.1rem;
  bottom: 1.1rem;
  z-index: 10000;
  display: flex;
  align-items: center;
  gap: 0.15rem;
}

.theme-fab,
.theme-menu-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: color 0.2s ease, transform 0.2s ease;
}

.theme-fab {
  width: 2.75rem;
  height: 2.75rem;
}

.theme-menu-btn {
  width: 1.65rem;
  height: 2.75rem;
  opacity: 0.7;
}

.theme-fab:hover,
.theme-menu-btn:hover {
  color: var(--accent);
  opacity: 1;
}

.theme-fab:hover {
  transform: scale(1.08);
}

.theme-fab:active {
  transform: scale(0.94);
}

.theme-fab:focus-visible,
.theme-menu-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.theme-fab svg {
  width: 1.45rem;
  height: 1.45rem;
  display: block;
}

.theme-menu-btn svg {
  width: 1.1rem;
  height: 1.1rem;
  display: block;
  transition: transform 0.2s ease;
}

.theme-dock.is-open .theme-menu-btn svg {
  transform: rotate(180deg);
}

.theme-fab .icon-sun {
  display: none;
}

html[data-theme="dark"] .theme-fab .icon-moon {
  display: none;
}

html[data-theme="dark"] .theme-fab .icon-sun {
  display: block;
}

.theme-fab.is-busy {
  pointer-events: none;
}

.theme-menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + 0.55rem);
  min-width: 9.5rem;
  padding: 0.45rem;
  border: 1px solid var(--line);
  background: var(--paper);
  box-shadow: 0 12px 32px -16px rgba(0, 0, 0, 0.35);
}

.theme-menu[hidden] {
  display: none;
}

.theme-menu-label {
  margin: 0;
  padding: 0.35rem 0.5rem 0.45rem;
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

.theme-swatch {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 0.55rem;
  padding: 0.45rem 0.5rem;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 0.875rem;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease;
}

.theme-swatch:hover,
.theme-swatch[aria-checked="true"] {
  background: var(--hover-bg);
}

.theme-swatch[aria-checked="true"] {
  color: var(--accent);
  font-weight: 500;
}

.theme-swatch-dot {
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 50%;
  background: var(--swatch);
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12);
}

/*
  Circular theme wipe from the FAB.
  Both old and new page snapshots stay visible - new theme expands as a circle.
*/
::view-transition-old(root),
::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}

::view-transition-old(root) {
  z-index: 1;
}

::view-transition-new(root) {
  z-index: 2;
  animation: theme-circle-in 0.55s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes theme-circle-in {
  from {
    clip-path: circle(0% at var(--theme-x, 100%) var(--theme-y, 100%));
  }
  to {
    clip-path: circle(150% at var(--theme-x, 100%) var(--theme-y, 100%));
  }
}

.menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  height: 2.5rem;
  padding: 0 0.9rem;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-size: 0.875rem;
  cursor: pointer;
}

.nav-mobile {
  display: none;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.75rem 1.25rem 1.25rem;
  border-top: 1px solid var(--line);
}

.nav-mobile.is-open {
  display: flex;
}

@media (max-width: 767px) {
  .menu-btn {
    display: inline-flex;
  }
}

/* ----- Hero ----- */
.hero {
  position: relative;
  overflow: clip;
}

.hero-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 42% 38% at 22% 32%, var(--accent-soft), transparent 72%),
    radial-gradient(ellipse 36% 30% at 8% 12%, var(--hero-glow), transparent 70%);
  opacity: 0.75;
}

.hero-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr;
  min-height: auto;
  align-items: center;
  justify-items: start;
  gap: 2.5rem;
  padding: 2.75rem 0 4rem;
}

.hero-copy {
  position: relative;
  min-width: 0;
  width: 100%;
  max-width: 48rem;
}

.hero-kicker {
  margin-bottom: 1.25rem;
}

.hero-eyebrow {
  margin: 0;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  line-height: 1.65;
  text-transform: uppercase;
  color: var(--accent);
}

.hero-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.18;
  font-size: clamp(1.65rem, 3.8vw, 2.65rem);
  color: var(--ink);
  max-width: 38rem;
  text-wrap: balance;
}

.hero-headline {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.02em;
  font-size: clamp(1.2rem, 2.2vw, 1.55rem);
  color: var(--ink-soft);
  margin: 1.25rem 0 0;
  max-width: 40rem;
  line-height: 1.5;
  border-left: 2px solid var(--accent);
  padding-left: 0.9rem;
}

.hero-support {
  margin: 1.35rem 0 0;
  max-width: 42rem;
  font-size: 1.0625rem;
  line-height: 1.72;
  color: var(--muted);
}

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 2rem;
}

.hero-stats {
  margin-top: 2.5rem;
  width: 100%;
  max-width: 48rem;
}

.hero-stats.proof-strip {
  margin-top: 2.5rem;
}

.hero-stats .proof-item {
  padding: 1rem 1rem;
}

.hero-stats .proof-label {
  font-size: 0.72rem;
  line-height: 1.35;
}

.hero-stats .proof-value--text {
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.proof-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin-top: 2.5rem;
  border: 1px solid var(--line);
  background: var(--line);
}

.proof-item {
  background: var(--paper);
  padding: 1.15rem 1.25rem;
}

.proof-value {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  line-height: 1.2;
}

.proof-label {
  margin-top: 0.35rem;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.4;
}

@media (min-width: 768px) {
  .proof-strip {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.about-highlights {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  margin-top: 1.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.about-highlights span {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.about-highlights span::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

/* ----- Sections ----- */
.section {
  padding: 5rem 0;
}

.section-label {
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
}

.section-title {
  margin: 0.75rem 0 0;
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 3.5vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--ink);
  line-height: 1.15;
}

.work-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  padding: 2.5rem 1rem;
  margin-inline: -1rem;
  border-top: 1px solid var(--line);
  border-left: 2px solid transparent;
  transition:
    background 0.2s ease,
    border-left-color 0.2s ease;
}

.work-title-group {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  min-width: 0;
}

.work-index {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  color: var(--accent);
  flex-shrink: 0;
}

.work-row:hover {
  background: var(--hover-bg);
  border-left-color: var(--accent);
}

.work-row:last-of-type {
  border-bottom: 1px solid var(--line);
}

.work-meta {
  font-size: 0.875rem;
  color: var(--muted);
}

.work-role {
  margin: 0.35rem 0 0;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--accent);
}

.work-list {
  margin: 1rem 0 0;
  padding-left: 1.15rem;
  color: var(--ink-soft);
}

.work-list li + li {
  margin-top: 0.45rem;
}

.work-stack {
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: 0.875rem;
}

.skill-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}

.skill-group {
  padding: 1.25rem 1.35rem;
  background: var(--surface);
  border: 1px solid var(--line);
  transition: border-color 0.2s ease, background 0.2s ease;
}

.skill-group:hover {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--line));
  background: var(--hover-bg);
}

.skill-group h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  margin: 0 0 0.5rem;
  color: var(--ink);
}

.skill-list {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
  line-height: 1.7;
}

.exp-block {
  display: grid;
  gap: 1rem;
  padding: 2rem 0;
  border-top: 1px solid var(--line);
}

.exp-block:last-of-type {
  border-bottom: 1px solid var(--line);
}

.contact-link {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent);
  text-underline-offset: 4px;
  transition: text-decoration-color 0.2s ease;
}

.contact-link:hover {
  text-decoration-color: var(--accent);
}

/* ----- Reveal ----- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 0.65s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 {
  transition-delay: 0.08s;
}
.reveal-delay-2 {
  transition-delay: 0.16s;
}
.reveal-delay-3 {
  transition-delay: 0.24s;
}

/* ----- Buttons ----- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.3rem;
  background: var(--ink);
  color: var(--btn-fg);
  font-weight: 500;
  font-size: 0.95rem;
  text-decoration: none;
  border: 1px solid var(--ink);
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.btn-primary:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-on);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.3rem;
  color: var(--ink);
  font-weight: 500;
  font-size: 0.95rem;
  text-decoration: none;
  border: 1px solid var(--line);
  background: transparent;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

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

/* ----- Footer ----- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 2rem 0;
  color: var(--muted);
  font-size: 0.875rem;
}

/* ----- Layout helpers ----- */
.container {
  width: 100%;
  max-width: 72rem;
  margin-inline: auto;
  padding-inline: 1.25rem;
}

@media (min-width: 768px) {
  .container {
    padding-inline: 2rem;
  }

  .hero-shell {
    padding: 3.5rem 0 5rem;
  }

  .hero-copy {
    max-width: 48rem;
  }

  .hero-title {
    max-width: 40rem;
  }

  .hero-support {
    max-width: 44rem;
    font-size: 1.125rem;
  }

  .hero-stats {
    max-width: 48rem;
  }

  .hero-stats .proof-item {
    padding: 1.1rem 1.15rem;
  }

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

  .exp-block {
    grid-template-columns: 1fr 2fr;
    gap: 2rem;
  }
}

@media (min-width: 1024px) {
  .skill-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ----- Responsive ----- */
@media (max-width: 640px) {
  .section {
    padding: 3.75rem 0;
  }
}

/* ----- Reduced motion ----- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .reveal {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }

  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation: none !important;
  }
}
