/* =============================================================
   Ember — portfolio one-pager
   Vanilla CSS rewrite of the "Ember Portfolio" design system.
   All values below are the same design tokens the original React
   components consumed as CSS custom properties — nothing here is
   guessed, it's the DS's own numbers, just poured into plain CSS.
   ============================================================= */

:root {
  /* ---- Ink (dark neutrals, the whole canvas) ---- */
  --ink-900: #101012;
  --ink-850: #17171a;
  --ink-800: #1c1c20;
  --ink-700: #232328;
  --ink-600: #2b2b31;
  --ink-500: #34343b;
  --ink-400: #44444d;

  /* ---- Paper (light neutrals, all text) ---- */
  --paper-0: #ffffff;
  --paper-100: #f3f1ec;
  --paper-200: #ddd9d1;
  --paper-300: #b3afa7;
  --paper-400: #8a867e;
  --paper-500: #63605a;

  /* ---- Amber (the single accent hue) ---- */
  --amber-200: #fbe7bd;
  --amber-300: #f8d28a;
  --amber-400: #f5be59;
  --amber-500: #f0a63c;
  --amber-600: #d9861f;
  --amber-700: #a76316;

  /* ---- Semantic surfaces ---- */
  --bg-page: var(--ink-850);
  --bg-page-alt: var(--ink-800);
  --surface-card: var(--ink-700);
  --surface-raised: var(--ink-600);
  --surface-inset: var(--ink-900);
  --surface-accent: var(--amber-400);
  --surface-accent-soft: rgba(240, 166, 60, 0.12);
  --surface-hover: rgba(243, 241, 236, 0.05);

  /* ---- Semantic text ---- */
  --text-display: var(--paper-100);
  --text-body: var(--paper-200);
  --text-secondary: var(--paper-300);
  --text-muted: var(--paper-400);
  --text-accent: var(--amber-500);
  --text-on-accent: var(--ink-900);
  --text-link: var(--amber-500);
  --text-link-hover: var(--amber-300);

  /* ---- Semantic borders ---- */
  --border-subtle: rgba(243, 241, 236, 0.07);
  --border-default: rgba(243, 241, 236, 0.13);
  --border-strong: rgba(243, 241, 236, 0.22);
  --border-accent: var(--amber-500);
  --border-hover: rgba(240, 166, 60, 0.35);

  --focus-ring: rgba(240, 166, 60, 0.55);

  /* ---- Type ---- */
  --font-display: "Playfair Display", Georgia, "Times New Roman", serif;
  --font-sans: "Manrope", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --text-2xs: 11px;
  --text-xs: 12px;
  --text-sm: 14px;
  --text-base: 16px;
  --text-md: 18px;
  --text-lg: 21px;
  --text-xl: 26px;
  --text-2xl: 32px;
  --text-3xl: 40px;
  --text-4xl: 52px;
  --text-5xl: 66px;

  --leading-snug: 1.2;
  --leading-normal: 1.45;
  --leading-relaxed: 1.7;

  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;
  --weight-black: 800;

  --tracking-tight: -0.02em;
  --tracking-wide: 0.06em;
  --tracking-widest: 0.16em;

  /* ---- Spacing (4px base) ---- */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  --space-20: 80px;
  --space-24: 96px;

  --container-max: 1180px;
  --page-gutter: 40px;
  --page-gutter-mobile: 20px;

  --control-h-sm: 34px;
  --control-h-md: 42px;
  --control-h-lg: 50px;
  --tap-min: 44px;

  /* ---- Effects ---- */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-pill: 999px;
  --radius-card: var(--radius-lg);
  --radius-control: var(--radius-md);
  --radius-media: var(--radius-sm);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 22px 60px rgba(0, 0, 0, 0.45);

  --blur-panel: blur(14px);
  --scrim-media: linear-gradient(
    to top,
    rgba(16, 16, 18, 0.92) 0%,
    rgba(16, 16, 18, 0) 62%
  );

  --dur-fast: 160ms;
  --dur-base: 240ms;
  --dur-slow: 420ms;
  --ease-out: cubic-bezier(0.22, 0.72, 0.2, 1);
  --ease-entrance: cubic-bezier(0.16, 0.9, 0.28, 1);

  --nav-h: 74px;
}

/* ---- Reset / base ---- */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-h);
}
body {
  margin: 0;
  background: var(--bg-page);
  color: var(--text-body);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  -webkit-font-smoothing: antialiased;
  text-wrap: pretty;
}
h1,
h2,
h3 {
  font-family: var(--font-display);
  color: var(--text-display);
  line-height: var(--leading-snug);
  margin: 0;
}
p {
  margin: 0;
}
a {
  color: var(--text-link);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease-out);
}
a:hover {
  color: var(--text-link-hover);
}
button {
  font: inherit;
  color: inherit;
}
:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}
::selection {
  background: var(--amber-500);
  color: var(--ink-900);
}
img {
  display: block;
  max-width: 100%;
}
ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding-inline: var(--page-gutter);
}

.icon {
  display: inline-block;
  flex: none;
  width: 1em;
  height: 1em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* =============================================================
   Nav
   ============================================================= */
.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(23, 23, 26, 0.9);
  backdrop-filter: var(--blur-panel);
  -webkit-backdrop-filter: var(--blur-panel);
  border-bottom: 1px solid var(--border-subtle);
}
.nav__inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: var(--space-5) var(--page-gutter);
  min-height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-8);
}
.nav__brand {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  color: var(--text-display);
  letter-spacing: var(--tracking-tight);
}
.nav__brand:hover {
  color: var(--text-display);
}
.nav__brand .dot {
  color: var(--text-accent);
}

.nav__toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  background: none;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  cursor: pointer;
  color: var(--text-display);
}
.nav__toggle .icon {
  width: 22px;
  height: 22px;
}
.nav__toggle .icon--close {
  display: none;
}
.nav__toggle.is-open .icon--menu {
  display: none;
}
.nav__toggle.is-open .icon--close {
  display: inline-block;
}

.nav__menu {
  display: flex;
  align-items: center;
  gap: var(--space-6);
}
.nav__links {
  display: flex;
  align-items: center;
  gap: var(--space-6);
}
.nav__link {
  position: relative;
  display: inline-block;
  padding: var(--space-1) 0;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--text-secondary);
  transition: color var(--dur-fast) var(--ease-out);
}
.nav__link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -3px;
  height: 2px;
  background: var(--surface-accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--dur-base) var(--ease-out);
}
.nav__link:hover {
  color: var(--text-display);
}
.nav__link.is-active {
  color: var(--text-display);
}
.nav__link.is-active::after {
  transform: scaleX(1);
}

/* =============================================================
   Buttons
   ============================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-family: var(--font-sans);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-wide);
  border-radius: var(--radius-control);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition:
    background var(--dur-fast) var(--ease-out),
    color var(--dur-fast) var(--ease-out),
    border-color var(--dur-fast) var(--ease-out),
    transform 90ms var(--ease-out);
}
.btn:active {
  transform: translateY(1px);
}
.btn--lg {
  height: var(--control-h-lg);
  padding: 0 var(--space-8);
  font-size: var(--text-lg);
}
.btn--md {
  height: var(--control-h-md);
  padding: 0 var(--space-10);
  font-size: var(--text-sm);
}
.btn--primary {
  background: var(--surface-accent);
  color: var(--text-on-accent);
  border-color: var(--surface-accent);
}
.btn--primary:hover {
  background: var(--amber-300);
  border-color: var(--amber-300);
  color: var(--text-on-accent);
}
.btn--outline {
  background: transparent;
  color: var(--text-accent);
  border-color: var(--border-accent);
}
.btn--outline:hover {
  background: var(--surface-accent-soft);
  color: var(--amber-300);
  border-color: var(--amber-300);
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-control);
  color: var(--text-secondary);
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  transition:
    background var(--dur-fast) var(--ease-out),
    color var(--dur-fast) var(--ease-out);
}
.icon-btn:hover {
  color: var(--text-accent);
  background: var(--surface-hover);
}
.icon-btn .icon {
  width: 18px;
  height: 18px;
}

/* =============================================================
   Hero
   ============================================================= */
@keyframes emberRise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.hero {
  padding: var(--space-24) 0 var(--space-20);
  animation: emberRise 640ms var(--ease-entrance) both;
}
.hero .container {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: var(--space-12);
  align-items: center;
}
.hero__intro {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  align-items: flex-start;
}
.hero__eyebrow {
  margin: 0;
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
  flex-wrap: wrap;
  line-height: 1.15;
}
.hero__eyebrow-label {
  font-size: var(--text-lg);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: var(--text-secondary);
}
.hero__name {
  font-family: var(--font-display);
  font-size: clamp(38px, 4.4vw, 66px);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-tight);
  color: var(--text-accent);
  line-height: 1.1;
}
.hero__tagline {
  margin: 0;
  max-width: 420px;
  font-size: var(--text-md);
  line-height: 1.45;
  color: var(--text-secondary);
}

.typewriter {
  height: var(--text-4xl);
  display: inline-flex;
  align-items: center;
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-accent);
  border: 1px solid var(--border-accent);
  font-family: var(--font-mono);
  font-size: var(--text-xl);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  white-space: pre;
}
.typewriter__caret {
  display: inline-block;
  width: 0.4ch;
  margin-left: 0.1ch;
  align-self: stretch;
  background: currentColor;
  animation: ember-caret 1.06s steps(1, end) infinite;
}
@keyframes ember-caret {
  0%,
  49% {
    opacity: 1;
  }
  50%,
  100% {
    opacity: 0;
  }
}

.stats {
  display: flex;
  gap: var(--space-10);
  flex-wrap: wrap;
  margin-top: var(--space-4);
}
.stat {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.stat__value {
  font-size: var(--text-2xl);
  font-weight: var(--weight-black);
  letter-spacing: var(--tracking-tight);
  color: var(--text-display);
  line-height: 1;
}
.stat__suffix {
  color: var(--text-accent);
}
.stat__label {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.hero__visual {
  display: flex;
  gap: var(--space-6);
  align-items: center;
  justify-content: flex-end;
}

.hero__portrait {
  width: 380px;
  max-width: 46vw;
  aspect-ratio: 3/4;
  border-radius: var(--radius-media);
}

.social-rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
}
.social-rail__rule {
  width: 1px;
  height: 72px;
  margin-bottom: var(--space-3);
  background: var(--border-accent);
}

/* =============================================================
   Section shell
   ============================================================= */
.section {
  padding: var(--space-24) 0;
}
.section--alt {
  background: var(--bg-page-alt);
}
.section--split .container {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: var(--space-12);
  align-items: start;
}
.section--centered .container {
  display: flex;
  flex-direction: column;
  gap: var(--space-10);
  align-items: center;
}

.section-heading {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  align-items: flex-start;
  text-align: left;
}
.section-heading--center {
  align-items: center;
  text-align: center;
}
.section-heading__eyebrow {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: var(--text-accent);
}
.section-heading__title {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: var(--weight-bold);
  line-height: var(--leading-snug);
  color: var(--text-display);
}
.section-heading__rule {
  width: 48px;
  height: 2px;
  background: var(--surface-accent);
  border-radius: 2px;
}
.section-heading--center .section-heading__rule {
  width: 64px;
}

/* ---- About ---- */
.about {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  max-width: 760px;
}
.about__lead {
  margin: 0;
  font-size: var(--text-md);
  line-height: 1.7;
  color: var(--text-body);
}
.about__note {
  margin: 0;
  font-size: var(--text-sm);
  line-height: 1.7;
  color: var(--text-secondary);
}
.about__note strong {
  color: var(--text-accent);
  font-weight: var(--weight-medium);
}

/* ---- Skills ---- */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-5);
  width: 100%;
}
.skill-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  min-height: 118px;
  padding: var(--space-5) var(--space-3);
  border-radius: var(--radius-card);
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm);
  transition: all var(--dur-base) var(--ease-out);
}
.skill-tile:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-hover);
}
.skill-tile img {
  width: 34px;
  height: 34px;
}
.skill-tile__name {
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  text-align: center;
  line-height: 1.3;
  color: var(--text-body);
}

/* ---- Experience / timeline ---- */
.timeline-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-6);
}
.timeline-item__rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
}
.badge {
  display: inline-flex;
  align-items: center;
  height: 24px;
  width: 150px;
  justify-content: center;
  padding: 0 var(--space-3);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-wide);
  background: var(--surface-raised);
  color: var(--text-secondary);
  border: 1px solid var(--border-default);
}
.timeline-item__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--surface-accent);
  box-shadow: 0 0 0 4px rgba(240, 166, 60, 0.14);
}
.timeline-item__line {
  flex: 1;
  width: 1px;
  min-height: 40px;
  background: var(--border-default);
}
.timeline-item__content {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding-bottom: var(--space-10);
}
.timeline-item:last-child .timeline-item__content {
  padding-bottom: 0;
}
.timeline-item__role {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--text-md);
  font-weight: var(--weight-semibold);
  color: var(--text-display);
}
.timeline-item__meta {
  font-size: var(--text-sm);
  color: var(--text-accent);
}
.timeline-item__meta .sep {
  color: var(--text-muted);
}
.timeline-item__desc {
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
  color: var(--text-secondary);
}

/* ---- Contact ---- */
.contact-chips {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
  justify-content: center;
}
.contact-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  min-height: var(--tap-min);
  padding: 0 var(--space-5);
  background: var(--surface-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-pill);
  font-size: var(--text-sm);
  color: var(--text-body);
  transition: all var(--dur-fast) var(--ease-out);
}
.contact-chip:hover {
  border-color: var(--border-accent);
  color: var(--text-accent);
}
.contact-chip .icon {
  width: 16px;
  height: 16px;
  color: var(--text-accent);
}

/* ---- Footer ---- */
.footer {
  padding: var(--space-8) 0;
}
.footer .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-6);
  flex-wrap: wrap;
}
.footer__brand {
  font-family: var(--font-display);
  font-size: var(--text-md);
  font-weight: var(--weight-bold);
  color: var(--text-display);
}
.footer__brand .dot {
  color: var(--text-accent);
}
.footer__copy {
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  letter-spacing: var(--tracking-wide);
  color: var(--text-muted);
}

.footer__copy svg{
  margin-right: 0.2rem;
}

/* =============================================================
   Responsive
   ============================================================= */
@media (max-width: 860px) {
  :root {
    --page-gutter: 24px;
  }
  .nav__toggle {
    display: inline-flex;
  }
  .nav__menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--ink-800);
    border-bottom: 1px solid var(--border-subtle);
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--dur-base) var(--ease-out);
  }
  .nav__menu.is-open {
    max-height: 340px;
  }
  .nav__links {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: var(--space-4) var(--page-gutter);
  }
  .nav__link {
    padding: var(--space-3) 0;
  }
  .nav__link::after {
    display: none;
  }

  .hero .container {
    grid-template-columns: 1fr;
    gap: var(--space-10);
  }
  .hero__visual {
    justify-content: flex-start;
  }
  .hero__portrait {
    width: 260px;
    max-width: 60vw;
  }

  .section--split .container {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }
  .skills-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .projects-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .hero__eyebrow {
    gap: var(--space-2);
  }
  .stats {
    gap: var(--space-6);
  }
  .hero__visual {
    flex-direction: column-reverse;
    align-items: flex-start;
  }
  .social-rail {
    flex-direction: row;
  }
  .social-rail__rule {
    width: 32px;
    height: 1px;
    margin: 0 var(--space-3) 0 0;
  }
}
