/* ============================================================
   DESIGN TOKENS — "Creativity × Technology"
   Warm amber creativity meets cool blue-teal technology
   ============================================================ */

:root {
  /* Type Scale */
  --text-xs:   clamp(0.75rem,  0.7rem  + 0.25vw, 0.875rem);
  --text-sm:   clamp(0.875rem, 0.8rem  + 0.35vw, 1rem);
  --text-base: clamp(1rem,     0.95rem + 0.25vw, 1.125rem);
  --text-lg:   clamp(1.125rem, 1rem    + 0.75vw, 1.5rem);
  --text-xl:   clamp(1.5rem,   1.2rem  + 1.25vw, 2.25rem);
  --text-2xl:  clamp(2rem,     1.2rem  + 2.5vw,  3.5rem);
  --text-3xl:  clamp(2.5rem,   1rem    + 4vw,    5rem);
  --text-hero: clamp(3rem,     0.5rem  + 7vw,    8rem);

  /* Spacing */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  /* Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-full: 9999px;

  /* Transition */
  --transition-interactive: 180ms cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  /* Content widths */
  --content-narrow: 640px;
  --content-default: 960px;
  --content-wide: 1200px;

  /* Fonts */
  --font-display: 'Clash Display', 'Helvetica Neue', sans-serif;
  --font-body: 'Satoshi', 'Inter', sans-serif;
}

/* ============================================================
   LIGHT MODE — Warm cream + amber/teal accent
   ============================================================ */
:root, [data-theme="light"] {
  --color-bg:             #faf8f5;
  --color-surface:        #ffffff;
  --color-surface-2:      #f5f2ed;
  --color-surface-offset: #eee9e1;
  --color-divider:        #e0d8cc;
  --color-border:         #d4c9b8;

  --color-text:           #1a1612;
  --color-text-muted:     #6b6359;
  --color-text-faint:     #a49b8f;
  --color-text-inverse:   #faf8f5;

  /* Creativity accent — warm amber */
  --color-creativity:     #c77016;
  --color-creativity-light: #f5dfc4;

  /* Technology accent — cool teal-blue */
  --color-technology:     #0e7490;
  --color-technology-light: #c4e5ed;

  /* Primary = intersection blend */
  --color-primary:        #0e7490;
  --color-primary-hover:  #0a5e74;
  --color-primary-highlight: #d0e8ef;

  /* Gradient intersection */
  --gradient-intersection: linear-gradient(135deg, #c77016 0%, #0e7490 100%);
  --gradient-intersection-soft: linear-gradient(135deg, #f5dfc4 0%, #c4e5ed 100%);

  --shadow-sm: 0 1px 2px rgba(26, 22, 18, 0.06);
  --shadow-md: 0 4px 16px rgba(26, 22, 18, 0.08);
  --shadow-lg: 0 12px 32px rgba(26, 22, 18, 0.12);
}

/* ============================================================
   DARK MODE
   ============================================================ */
[data-theme="dark"] {
  --color-bg:             #121110;
  --color-surface:        #1a1917;
  --color-surface-2:      #222120;
  --color-surface-offset: #1e1d1b;
  --color-divider:        #2e2d2b;
  --color-border:         #3a3937;

  --color-text:           #e8e4df;
  --color-text-muted:     #948e86;
  --color-text-faint:     #5e5a55;
  --color-text-inverse:   #121110;

  --color-creativity:     #e8923e;
  --color-creativity-light: #3a2a18;

  --color-technology:     #38b2cc;
  --color-technology-light: #162a30;

  --color-primary:        #38b2cc;
  --color-primary-hover:  #4fc4dd;
  --color-primary-highlight: #1c2f35;

  --gradient-intersection: linear-gradient(135deg, #e8923e 0%, #38b2cc 100%);
  --gradient-intersection-soft: linear-gradient(135deg, #3a2a18 0%, #162a30 100%);

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.4);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.5);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg:             #121110;
    --color-surface:        #1a1917;
    --color-surface-2:      #222120;
    --color-surface-offset: #1e1d1b;
    --color-divider:        #2e2d2b;
    --color-border:         #3a3937;
    --color-text:           #e8e4df;
    --color-text-muted:     #948e86;
    --color-text-faint:     #5e5a55;
    --color-text-inverse:   #121110;
    --color-creativity:     #e8923e;
    --color-creativity-light: #3a2a18;
    --color-technology:     #38b2cc;
    --color-technology-light: #162a30;
    --color-primary:        #38b2cc;
    --color-primary-hover:  #4fc4dd;
    --color-primary-highlight: #1c2f35;
    --gradient-intersection: linear-gradient(135deg, #e8923e 0%, #38b2cc 100%);
    --gradient-intersection-soft: linear-gradient(135deg, #3a2a18 0%, #162a30 100%);
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.4);
    --shadow-lg: 0 12px 32px rgba(0,0,0,0.5);
  }
}

/* ============================================================
   LAYOUT
   ============================================================ */
.container {
  max-width: var(--content-wide);
  margin-inline: auto;
  padding-inline: var(--space-6);
}

.section {
  padding-block: clamp(var(--space-12), 8vw, var(--space-24));
}

/* ============================================================
   HEADER / NAV
   ============================================================ */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--color-bg) 90%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--color-divider);
  transition: transform 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: var(--space-4);
}

.header__logo {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-text);
  text-decoration: none;
}

.header__logo span {
  background: var(--gradient-intersection);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header__nav {
  display: flex;
  align-items: center;
  gap: var(--space-6);
}

.header__nav a {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  text-decoration: none;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: color var(--transition-interactive);
}

.header__nav a:hover {
  color: var(--color-text);
}

.theme-toggle {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  color: var(--color-text-muted);
  transition: color var(--transition-interactive), background var(--transition-interactive);
}

.theme-toggle:hover {
  color: var(--color-text);
  background: var(--color-surface-2);
}

/* Mobile nav */
.mobile-menu-btn {
  display: none;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  color: var(--color-text);
}

@media (max-width: 768px) {
  .header__nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-divider);
    flex-direction: column;
    padding: var(--space-6);
    gap: var(--space-4);
  }
  .header__nav.open { display: flex; }
  .mobile-menu-btn { display: flex; }
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  min-height: 90vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.hero__content {
  position: relative;
  z-index: 2;
  max-width: 800px;
}

.hero__tagline {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: var(--space-4);
}

.hero__name {
  font-family: var(--font-display);
  font-size: var(--text-hero);
  font-weight: 700;
  line-height: 0.95;
  color: var(--color-text);
  margin-bottom: var(--space-6);
}

.hero__name .gradient-text {
  background: var(--gradient-intersection);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero__subtitle {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 500;
  color: var(--color-text-muted);
  margin-bottom: var(--space-8);
  line-height: 1.3;
}

.hero__description {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  max-width: 560px;
  line-height: 1.7;
  margin-bottom: var(--space-8);
}

.hero__cta-row {
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  font-size: var(--text-sm);
  font-weight: 600;
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: all var(--transition-interactive);
}

.btn--primary {
  background: var(--gradient-intersection);
  color: #fff;
}

.btn--primary:hover {
  opacity: 0.9;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn--secondary {
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
}

.btn--secondary:hover {
  background: var(--color-surface-2);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

/* Hero background animation — intersection grid */
.hero__bg {
  position: absolute;
  inset: 0;
  z-index: 1;
  opacity: 0.08;
  pointer-events: none;
}

.hero__bg canvas {
  width: 100%;
  height: 100%;
}

/* ============================================================
   INTERSECTION BADGE — Creativity × Technology
   ============================================================ */
.intersection-bar {
  background: var(--gradient-intersection-soft);
  border-top: 1px solid var(--color-divider);
  border-bottom: 1px solid var(--color-divider);
}

.intersection-bar__inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--space-8);
  padding-block: var(--space-8);
}

.intersection-side {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.intersection-side:last-child {
  justify-content: flex-end;
}

.intersection-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.intersection-icon--creativity {
  background: var(--color-creativity-light);
  color: var(--color-creativity);
}

.intersection-icon--technology {
  background: var(--color-technology-light);
  color: var(--color-technology);
}

.intersection-label {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-text);
}

.intersection-cross {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background: var(--gradient-intersection);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  box-shadow: var(--shadow-md);
}

@media (max-width: 640px) {
  .intersection-bar__inner {
    grid-template-columns: 1fr;
    gap: var(--space-4);
    text-align: center;
  }
  .intersection-side,
  .intersection-side:last-child {
    justify-content: center;
  }
  .intersection-cross {
    margin-inline: auto;
  }
}

/* ============================================================
   ABOUT
   ============================================================ */
.about__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-12);
  align-items: start;
}

@media (max-width: 768px) {
  .about__grid {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }
}

.section__label {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-primary);
  margin-bottom: var(--space-3);
}

.section__title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: var(--space-6);
}

.about__text p {
  color: var(--color-text-muted);
  margin-bottom: var(--space-4);
  line-height: 1.7;
}

.about__text p:last-child {
  margin-bottom: 0;
}

.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}

.stat-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  text-align: center;
}

.stat-card__number {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 700;
  background: var(--gradient-intersection);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-variant-numeric: tabular-nums;
}

.stat-card__label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: var(--space-1);
  font-weight: 500;
}

/* ============================================================
   EXPERIENCE TIMELINE
   ============================================================ */
.timeline {
  position: relative;
  padding-left: var(--space-8);
}

.timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--gradient-intersection);
  opacity: 0.3;
}

.timeline__item {
  position: relative;
  padding-bottom: var(--space-10);
}

.timeline__item:last-child {
  padding-bottom: 0;
}

.timeline__dot {
  position: absolute;
  left: calc(-1 * var(--space-8) + 1px);
  top: 6px;
  width: 14px;
  height: 14px;
  border-radius: var(--radius-full);
  background: var(--gradient-intersection);
  border: 3px solid var(--color-bg);
  box-shadow: 0 0 0 2px var(--color-primary);
}

.timeline__date {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  font-weight: 600;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-1);
}

.timeline__role {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-1);
}

.timeline__company {
  font-size: var(--text-sm);
  color: var(--color-primary);
  font-weight: 600;
  margin-bottom: var(--space-3);
}

.timeline__desc {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.7;
}

.timeline__desc ul {
  padding-left: var(--space-5);
  margin-top: var(--space-2);
}

.timeline__desc li {
  margin-bottom: var(--space-2);
}

/* ============================================================
   SKILLS CONSTELLATION
   ============================================================ */
.skills__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
}

@media (max-width: 768px) {
  .skills__grid {
    grid-template-columns: 1fr;
  }
}

.skill-category {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  transition: box-shadow var(--transition-interactive), transform var(--transition-interactive);
}

.skill-category:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.skill-category__icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-4);
}

.skill-category__icon--creativity {
  background: var(--color-creativity-light);
  color: var(--color-creativity);
}

.skill-category__icon--technology {
  background: var(--color-technology-light);
  color: var(--color-technology);
}

.skill-category__icon--intersection {
  background: var(--gradient-intersection-soft);
  color: var(--color-text);
}

.skill-category__title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-3);
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.skill-tag {
  font-size: var(--text-xs);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  background: var(--color-surface-2);
  color: var(--color-text-muted);
  font-weight: 500;
  border: 1px solid var(--color-divider);
}

.skill-tag--creativity {
  background: var(--color-creativity-light);
  color: var(--color-creativity);
  border-color: var(--color-creativity);
}

.skill-tag--technology {
  background: var(--color-technology-light);
  color: var(--color-technology);
  border-color: var(--color-technology);
}

/* ============================================================
   PATENTS & INNOVATIONS
   ============================================================ */
.patents__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-6);
}

.patent-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  position: relative;
  overflow: hidden;
}

.patent-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-intersection);
}

.patent-card__number {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  font-weight: 600;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-3);
}

.patent-card__title {
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-3);
  line-height: 1.4;
}

.patent-card__desc {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.6;
}

/* ============================================================
   EDUCATION
   ============================================================ */
.education-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  display: flex;
  gap: var(--space-6);
  align-items: start;
}

@media (max-width: 640px) {
  .education-card {
    flex-direction: column;
  }
}

.education-card__icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-lg);
  background: var(--gradient-intersection-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.education-card__school {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-1);
}

.education-card__degree {
  font-size: var(--text-base);
  color: var(--color-primary);
  font-weight: 500;
  margin-bottom: var(--space-1);
}

.education-card__dates {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  font-weight: 500;
}

/* ============================================================
   SPEAKING & COMMUNITY
   ============================================================ */
.community__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-6);
}

.community-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
}

.community-card__type {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-creativity);
  margin-bottom: var(--space-3);
}

.community-card__title {
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-2);
}

.community-card__meta {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
}

/* ============================================================
   TESTIMONIALS
   ============================================================ */
.testimonials__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-6);
}

@media (max-width: 768px) {
  .testimonials__grid {
    grid-template-columns: 1fr;
  }
}

.testimonial-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  position: relative;
}

.testimonial-card__quote {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  line-height: 1.7;
  font-style: italic;
  margin-bottom: var(--space-6);
}

.testimonial-card__quote::before {
  content: '\201C';
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  background: var(--gradient-intersection);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  display: block;
  margin-bottom: var(--space-2);
}

.testimonial-card__author {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
}

/* ============================================================
   CONTACT / FOOTER
   ============================================================ */
.contact {
  background: var(--color-surface-2);
  border-top: 1px solid var(--color-divider);
}

.contact__inner {
  text-align: center;
  max-width: 560px;
  margin-inline: auto;
}

.contact__links {
  display: flex;
  justify-content: center;
  gap: var(--space-4);
  flex-wrap: wrap;
  margin-top: var(--space-6);
}

.contact__link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  font-size: var(--text-sm);
  font-weight: 500;
  text-decoration: none;
  transition: all var(--transition-interactive);
}

.contact__link:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.footer {
  padding-block: var(--space-8);
  border-top: 1px solid var(--color-divider);
}

.footer__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-4);
}

.footer__text {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
}

.footer__text a {
  color: var(--color-text-muted);
  text-decoration: none;
}

.footer__text a:hover {
  color: var(--color-primary);
}

/* ============================================================
   SCROLL ANIMATIONS
   ============================================================ */
.fade-in {
  opacity: 1;
}

@supports (animation-timeline: scroll()) {
  .fade-in {
    opacity: 0;
    animation: reveal-fade linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 80%;
  }
}

@keyframes reveal-fade {
  to { opacity: 1; }
}

/* Fallback for browsers without scroll-driven animations */
@supports not (animation-timeline: scroll()) {
  .fade-in {
    opacity: 0;
    transition: opacity 0.6s var(--ease-out);
  }
  .fade-in.visible {
    opacity: 1;
  }
}

/* ============================================================
   INTERACTIVE BACKGROUND CANVAS
   ============================================================ */
#hero-canvas {
  position: absolute;
  inset: 0;
  z-index: 0;
}
