/*
  Personal Website Styles
  Design direction: modern editorial + technical product feel.
*/

:root {
  --bg: #fafafa;
  --surface: #ffffff;
  --surface-soft: #f3f4f6;
  --primary: #2563eb;
  --accent: #0ea5e9;
  --text: #111827;
  --muted: #6b7280;
  --border: #e5e7eb;
  --focus: #1d4ed8;
  --shadow-sm: 0 1px 2px rgba(17, 24, 39, 0.06), 0 1px 3px rgba(17, 24, 39, 0.08);
  --shadow-md: 0 12px 30px rgba(17, 24, 39, 0.08);
  --radius-sm: 0.5rem;
  --radius-md: 0.9rem;
  --radius-lg: 1.2rem;
  --content-width: 1100px;
  --gradient-hero: radial-gradient(circle at 15% 20%, rgba(14, 165, 233, 0.2), transparent 30%),
    radial-gradient(circle at 90% 10%, rgba(37, 99, 235, 0.18), transparent 30%),
    linear-gradient(120deg, #ffffff 0%, #f5f7ff 52%, #eef7ff 100%);
}

:root[data-theme="dark"] {
  --bg: #0f172a;
  --surface: #1e293b;
  --surface-soft: #17233a;
  --primary: #60a5fa;
  --accent: #38bdf8;
  --text: #f8fafc;
  --muted: #94a3b8;
  --border: #334155;
  --focus: #93c5fd;
  --shadow-sm: 0 1px 2px rgba(2, 6, 23, 0.3), 0 1px 4px rgba(2, 6, 23, 0.34);
  --shadow-md: 0 18px 40px rgba(2, 6, 23, 0.45);
  --gradient-hero: radial-gradient(circle at 15% 20%, rgba(56, 189, 248, 0.17), transparent 34%),
    radial-gradient(circle at 90% 10%, rgba(96, 165, 250, 0.18), transparent 28%),
    linear-gradient(120deg, #0f172a 0%, #111d33 55%, #0f1b31 100%);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Inter", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
}

.skip-link {
  position: absolute;
  top: -50px;
  left: 1rem;
  background: var(--primary);
  color: #fff;
  padding: 0.65rem 0.9rem;
  border-radius: var(--radius-sm);
  z-index: 1000;
}

.skip-link:focus-visible {
  top: 1rem;
}

.container {
  width: min(100% - 2rem, var(--content-width));
  margin-inline: auto;
}

.section {
  padding: 4.5rem 0;
}

.section-title {
  margin: 0;
  font-size: clamp(1.65rem, 4vw, 2.4rem);
  letter-spacing: -0.03em;
}

.section-intro {
  max-width: 70ch;
  margin-top: 0.8rem;
  color: var(--muted);
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: color-mix(in srgb, var(--primary) 12%, transparent);
  color: var(--primary);
  border: 1px solid color-mix(in srgb, var(--primary) 28%, transparent);
  border-radius: 999px;
  font-size: 0.83rem;
  font-weight: 600;
  padding: 0.35rem 0.7rem;
}

.surface {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.grid {
  display: grid;
  gap: 1rem;
}

.grid-2 {
  grid-template-columns: 1fr;
}

.grid-3 {
  grid-template-columns: 1fr;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.2rem;
  box-shadow: var(--shadow-sm);
  transition: transform 220ms ease, box-shadow 220ms ease, border-color 220ms ease;
}

.card:hover,
.card:focus-within {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: color-mix(in srgb, var(--primary) 35%, var(--border));
}

.card h3 {
  margin-top: 0;
  margin-bottom: 0.55rem;
  font-size: 1.1rem;
  letter-spacing: -0.01em;
}

.card p {
  margin: 0;
  color: var(--muted);
}

.icon-line {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.icon {
  width: 1.1rem;
  height: 1.1rem;
  flex-shrink: 0;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 999;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
}

.nav-wrap {
  min-height: 4.1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-decoration: none;
  font-size: 1rem;
}

.brand-logo {
  width: 2.1rem;
  height: 2.1rem;
  object-fit: contain;
  border-radius: 0.45rem;
  background: rgba(255, 255, 255, 0.78);
  padding: 0.14rem;
}

:root[data-theme="dark"] .brand-logo {
  background: rgba(248, 250, 252, 0.92);
  box-shadow: 0 0 0 1px rgba(148, 163, 184, 0.32), 0 2px 6px rgba(2, 6, 23, 0.55);
}

.brand-text {
  line-height: 1;
}

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

.nav-links {
  display: none;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 0.3rem;
}

.nav-links a {
  text-decoration: none;
  color: var(--muted);
  font-weight: 500;
  padding: 0.45rem 0.75rem;
  border-radius: 0.5rem;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--text);
  background: color-mix(in srgb, var(--primary) 12%, transparent);
}

.mobile-menu-button,
.theme-toggle {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 0.6rem;
  padding: 0.45rem;
  cursor: pointer;
}

.mobile-menu {
  border-top: 1px solid var(--border);
  padding: 0.6rem 0 1rem;
  display: none;
}

.mobile-menu.open {
  display: block;
}

.mobile-menu a {
  display: block;
  text-decoration: none;
  color: var(--muted);
  padding: 0.55rem 0;
  font-weight: 500;
}

.mobile-menu a[aria-current="page"] {
  color: var(--text);
}

.hero {
  padding: 6rem 0 4.25rem;
  background: var(--gradient-hero);
  border-bottom: 1px solid var(--border);
}
.hero-home {
  min-height: 85vh;
  display: flex;
  align-items: center;
  padding: clamp(5.5rem, 10vh, 7.2rem) 0;
}

.hero-layout {
  display: grid;
  gap: clamp(1.4rem, 3.6vw, 3rem);
  align-items: center;
}

.hero-copy {
  min-width: 0;
}
.hero-eyebrow {
  margin: 0;
  color: color-mix(in srgb, var(--accent) 62%, var(--primary));
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.hero-title {
  margin: 0.55rem 0 0;
  font-size: clamp(2.45rem, 7.2vw, 5rem);
  line-height: 1.02;
  letter-spacing: -0.045em;
  font-weight: 800;
  max-width: 14ch;
}
.hero-value {
  margin: 0.55rem 0 0;
  font-size: clamp(1.85rem, 5vw, 3.2rem);
  line-height: 1.08;
  font-weight: 650;
  color: color-mix(in srgb, var(--text) 88%, var(--accent));
}
.hero-value em {
  font-style: normal;
  color: color-mix(in srgb, var(--accent) 72%, var(--primary));
}
.hero-support {
  margin-top: 1.15rem;
  max-width: 650px;
  color: var(--muted);
  font-size: clamp(1.03rem, 2.1vw, 1.28rem);
  line-height: 1.72;
}
.hero-cred {
  list-style: none;
  margin: 1.25rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.85rem;
  color: color-mix(in srgb, var(--muted) 86%, var(--text));
  font-size: 0.94rem;
}
.hero-cred li + li::before {
  content: "•";
  margin-right: 0.85rem;
  color: color-mix(in srgb, var(--muted) 70%, transparent);
}

.hero-cred-line {
  margin: 1.25rem 0 0;
  color: color-mix(in srgb, var(--muted) 86%, var(--text));
  font-size: 0.96rem;
  line-height: 1.6;
  max-width: 72ch;
}

.hero-meta-title {
  margin: 1.1rem 0 0;
  font-size: 1.02rem;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.hero-meta-line {
  margin: 0.3rem 0 0;
  color: color-mix(in srgb, var(--muted) 86%, var(--text));
  font-size: 0.98rem;
  line-height: 1.6;
  max-width: 72ch;
}

.hero-aside {
  display: grid;
  gap: 1rem;
  justify-items: end;
}

.hero-logo {
  width: min(100%, 430px);
  padding: 1rem 1.15rem;
  border: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
  border-radius: calc(var(--radius-lg) + 0.2rem);
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  box-shadow: var(--shadow-sm);
}

.hero-logo img {
  display: block;
  width: 100%;
  height: auto;
}

.hero-logo-mark {
  width: min(100%, 320px);
  padding: 1.25rem;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow-md);
}

:root[data-theme="dark"] .hero-logo-mark {
  background: rgba(248, 250, 252, 0.92);
  box-shadow: 0 0 0 1px rgba(148, 163, 184, 0.32), 0 12px 30px rgba(2, 6, 23, 0.45);
}

.hero-media {
  margin: 0;
  width: min(100%, 430px);
  padding: 0.6rem;
  border: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
  border-radius: calc(var(--radius-lg) + 0.2rem);
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  box-shadow: var(--shadow-sm);
}

.hero-media img {
  width: 100%;
  height: auto;
  border-radius: calc(var(--radius-md) + 0.1rem);
  border: 1px solid var(--border);
  box-shadow: 0 12px 28px rgba(17, 24, 39, 0.14);
}

.hero:not(.hero-home) h1 {
  margin: 0;
  font-size: clamp(1.55rem, 4.6vw, 2.8rem);
  line-height: 1.08;
  letter-spacing: -0.05em;
  max-width: 18ch;
}

.contact-hero-title {
  font-size: clamp(4rem, 8vw, 4.5rem) !important;
  line-height: 1.03 !important;
  max-width: 15ch !important;
}

.contact-hero-subtitle {
  margin: 1rem 0 0;
  font-size: clamp(2rem, 4.2vw, 2.25rem);
  line-height: 1.15;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: color-mix(in srgb, var(--text) 90%, var(--accent));
}

.hero:not(.hero-home) p {
  margin-top: 1.2rem;
  max-width: 70ch;
  color: var(--muted);
  font-size: clamp(1.08rem, 2.35vw, 1.38rem);
}

.hero:not(.hero-home) blockquote {
  margin: 0.55rem 0 1rem;
  padding: 0.55rem 0.9rem;
  border-left: 3px solid color-mix(in srgb, var(--primary) 50%, transparent);
  background: color-mix(in srgb, var(--surface) 75%, var(--surface-soft));
  border-radius: 0.45rem;
}

.hero:not(.hero-home) blockquote p {
  margin: 0;
  color: var(--text);
  font-size: 1rem;
}

.hero-actions {
  margin-top: 1.8rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}
.hero-home .hero-copy > * {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 420ms ease, transform 420ms ease;
}
.hero-home .hero-aside {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 520ms ease, transform 520ms ease;
}
.hero-home .reveal.visible .hero-copy > * {
  opacity: 1;
  transform: translateY(0);
}
.hero-home .reveal.visible .hero-copy > :nth-child(2) {
  transition-delay: 60ms;
}
.hero-home .reveal.visible .hero-copy > :nth-child(3) {
  transition-delay: 100ms;
}
.hero-home .reveal.visible .hero-copy > :nth-child(4) {
  transition-delay: 140ms;
}
.hero-home .reveal.visible .hero-copy > :nth-child(5) {
  transition-delay: 180ms;
}
.hero-home .reveal.visible .hero-copy > :nth-child(6) {
  transition-delay: 210ms;
}

.hero-home .reveal.visible .hero-copy > :nth-child(7) {
  transition-delay: 240ms;
}

.hero-home .reveal.visible .hero-copy > :nth-child(8) {
  transition-delay: 270ms;
}
.hero-home .reveal.visible .hero-aside {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 120ms;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: 0.7rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  padding: 0.68rem 1.05rem;
  transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease;
}

.button:hover,
.button:focus-visible {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
  filter: brightness(1.03);
}

.button-primary {
  background: var(--primary);
  color: #fff;
}

.button-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}

.highlight-list {
  margin: 1.2rem 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.highlight-list li {
  font-size: 0.9rem;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.35rem 0.68rem;
  background: color-mix(in srgb, var(--surface) 87%, var(--surface-soft));
}

.project-card {
  display: grid;
  gap: 1rem;
}

.project-image {
  border-radius: 0.8rem;
  overflow: hidden;
  border: 1px solid var(--border);
}

.project-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
  margin-top: 1rem;
}

.project-meta dt {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 0.2rem;
}

.project-meta dd {
  margin: 0;
}

.talk-card,
.case-study,
.contact-card,
.testimonial-card {
  height: 100%;
}

.talk-card .project-image {
  aspect-ratio: 16 / 9;
  background: color-mix(in srgb, var(--surface-soft) 86%, var(--surface));
}

.talk-card .project-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.index-card-grid {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}

.index-card {
  background:
    repeating-linear-gradient(
      to bottom,
      rgba(17, 24, 39, 0.02) 0,
      rgba(17, 24, 39, 0.02) 1px,
      transparent 1px,
      transparent 9px
    ),
    linear-gradient(180deg, #fffefc 0%, #fdfcf8 100%);
  border: 1px solid color-mix(in srgb, var(--border) 84%, #d1d5db);
  border-radius: 0.7rem;
  box-shadow: 0 2px 8px rgba(17, 24, 39, 0.08);
  color: color-mix(in srgb, var(--text) 92%, #1f2937);
  font-weight: 500;
  line-height: 1.5;
  min-height: 7.5rem;
  padding: 1rem;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
}

:root[data-theme="dark"] .index-card {
  background:
    repeating-linear-gradient(
      to bottom,
      rgba(248, 250, 252, 0.03) 0,
      rgba(248, 250, 252, 0.03) 1px,
      transparent 1px,
      transparent 9px
    ),
    linear-gradient(180deg, #233145 0%, #1d2a3b 100%);
  border-color: color-mix(in srgb, var(--border) 85%, #475569);
  color: color-mix(in srgb, var(--text) 96%, #e2e8f0);
  box-shadow: 0 3px 9px rgba(2, 6, 23, 0.32);
}

.case-study {
  display: grid;
  gap: 1rem;
}

.case-study details {
  border-top: 1px solid var(--border);
  padding-top: 0.8rem;
}

.case-study summary {
  cursor: pointer;
  font-weight: 600;
}

.projects-grid {
  gap: 1rem;
}

.projects-grid .case-study {
  gap: 0.7rem;
  padding: 0.95rem;
  max-width: 360px;
  margin-inline: auto;
}

.projects-grid .project-thumb {
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 140px;
  display: block;
  margin-inline: auto;
  border-radius: 0.55rem;
  border: 1px dashed color-mix(in srgb, var(--border) 85%, #cbd5e1);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--surface-soft) 84%, var(--surface)) 0%, var(--surface) 100%);
}

.projects-grid .case-study .section-title {
  font-size: clamp(1.15rem, 2.15vw, 1.4rem);
  line-height: 1.24;
  color: color-mix(in srgb, var(--primary) 58%, var(--text));
}

:root[data-theme="dark"] .projects-grid .case-study .section-title {
  color: color-mix(in srgb, var(--accent) 45%, var(--text));
}

.projects-grid .case-study p {
  margin: 0;
  font-size: 0.93rem;
  line-height: 1.62;
}

.projects-grid .case-study .project-label {
  color: #1d4ed8;
  font-weight: 700;
  letter-spacing: 0.01em;
}

:root[data-theme="dark"] .projects-grid .case-study .project-label {
  color: #60a5fa;
}

.projects-grid .case-study .project-label-outcome {
  color: #4ade80;
}

:root[data-theme="dark"] .projects-grid .case-study .project-label-outcome {
  color: #86efac;
}

.projects-grid .case-study .key-insight-box {
  margin-top: 0.3rem;
  padding: 0.6rem 0.7rem;
  border-radius: 0.55rem;
  border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--border));
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
}

.projects-grid .case-study .project-label-insight {
  color: color-mix(in srgb, var(--accent) 65%, var(--primary));
}

:root[data-theme="dark"] .projects-grid .case-study .key-insight-box {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
  background: color-mix(in srgb, var(--accent) 14%, var(--surface));
}

.projects-grid .project-image {
  max-width: 320px;
  margin-inline: auto;
  aspect-ratio: 16 / 9;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--surface-soft) 86%, var(--surface));
}

.projects-grid .project-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: -webkit-optimize-contrast;
}

.projects-grid .case-study details {
  padding-top: 0.55rem;
}

.timeline {
  position: relative;
  margin-top: 1.5rem;
  padding-left: 1.2rem;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 0.2rem;
  top: 0.2rem;
  bottom: 0.2rem;
  width: 2px;
  background: var(--border);
}

.timeline-item {
  margin-bottom: 1.2rem;
  position: relative;
}

.timeline-item::before {
  content: "";
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 50%;
  background: var(--primary);
  position: absolute;
  left: -1.35rem;
  top: 0.35rem;
}

.contact-form {
  display: grid;
  gap: 0.8rem;
}

label {
  font-weight: 600;
  font-size: 0.95rem;
}

input,
textarea {
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.7rem 0.78rem;
  border-radius: 0.6rem;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

textarea {
  resize: vertical;
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  margin-top: 2rem;
}

.footer-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  color: var(--muted);
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.footer-nav a {
  text-decoration: none;
}

.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 500ms ease, transform 500ms ease;
}

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

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

@media (min-width: 720px) {
  .section {
    padding: 5.5rem 0;
  }

  .hero-layout {
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
    justify-content: space-between;
  }

  .hero-media {
    justify-self: end;
  }

  .hero-aside {
    justify-self: end;
  }
  .hero-home {
    min-height: 88vh;
  }

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

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

  .index-card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .project-card {
    grid-template-columns: 1.15fr 1fr;
    align-items: start;
  }

  .footer-wrap {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

@media (min-width: 900px) {
  .nav-links {
    display: flex;
  }

  .mobile-menu-button {
    display: none;
  }

  .mobile-menu {
    display: none !important;
  }
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
