:root {
  --bg: #141415;
  --panel: #1c1c1f;
  --rail: #2a2a2e;
  --card: #2c2d32;
  --cream: #fbf4e0;
  --body: #d8d7d6;
  --muted: #9b9a98;
  --gold: #c79864;
  --green: #00ff41;
  --line: rgba(199, 152, 100, 0.35);
  --sans: "Manrope", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}

* {
  box-sizing: border-box;
}

html {
  margin: 0;
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100%;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--body);
  font-family: var(--sans);
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
  background-size: 22px 22px;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body.menu-open {
  overflow: hidden;
  touch-action: none;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: 12px;
  z-index: 100;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--gold);
  color: #1a140c;
  font-weight: 700;
  font-size: 13px;
  transform: translateY(-140%);
  transition: transform 0.2s ease;
}

.skip-link:focus {
  transform: translateY(0);
  outline: none;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea {
  font: inherit;
}

.ambient,
.ambient-wash {
  display: none;
  z-index: 0;
}

.frame {
  position: relative;
  z-index: auto;
  display: grid;
  grid-template-columns: 72px 1fr;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 14px;
  gap: 14px;
}

.rail {
  position: relative;
  z-index: 80;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  padding: 22px 0 18px;
  border-radius: 16px;
  background: var(--rail);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.logo {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--gold);
  line-height: 1;
}

.menu-btn {
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  display: grid;
  gap: 5px;
  align-content: center;
  justify-items: center;
  position: relative;
  z-index: 70;
  -webkit-tap-highlight-color: transparent;
}

.menu-btn span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--gold);
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.menu-btn.is-open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.menu-btn.is-open span:nth-child(2) {
  opacity: 0;
}
.menu-btn.is-open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.rail-copy {
  margin: auto 0 8px;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: color-mix(in srgb, var(--gold) 70%, white);
  white-space: nowrap;
}

.stage {
  position: relative;
  border-radius: 18px;
  background: var(--panel);
  overflow: hidden;
  min-height: calc(100vh - 28px);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.lang {
  position: absolute;
  top: 32px;
  right: 32px;
  z-index: 80;
  display: inline-flex;
  gap: 2px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(23, 23, 26, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(8px);
}

.lang button {
  border: 0;
  background: transparent;
  color: var(--muted);
  min-width: 42px;
  height: 30px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 700;
  font-size: 12px;
}

.lang button.is-active {
  background: var(--gold);
  color: #1a140c;
}

.panel {
  display: none;
  height: 100%;
  min-height: calc(100vh - 28px);
}

.panel.is-active {
  display: block;
  animation: rise 0.45s ease both;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 28px;
  align-items: center;
  min-height: calc(100vh - 28px);
  padding: 42px 48px 42px 36px;
}

.hero-media {
  position: relative;
  height: min(72vh, 640px);
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid rgba(199, 152, 100, 0.28);
  box-shadow:
    0 0 0 3px #121214,
    0 24px 60px rgba(0, 0, 0, 0.45),
    0 0 40px rgba(199, 152, 100, 0.08);
  background: #050505;
  isolation: isolate;
}

#matrix {
  width: 100%;
  height: 100%;
  display: block;
}

.hero-media-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(8, 8, 10, 0.1), rgba(8, 8, 10, 0.35)),
    radial-gradient(circle at 70% 80%, rgba(0, 255, 65, 0.08), transparent 40%);
  pointer-events: none;
}

.hero-media-glow {
  position: absolute;
  inset: -20%;
  background: radial-gradient(circle at 30% 25%, rgba(199, 152, 100, 0.18), transparent 42%);
  pointer-events: none;
  animation: glow-breathe 5.5s ease-in-out infinite;
}

.hero-media-frame {
  position: absolute;
  inset: 14px;
  border: 1px solid rgba(199, 152, 100, 0.22);
  border-radius: 16px;
  pointer-events: none;
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.25);
}

.hero-media-badge {
  position: absolute;
  left: 28px;
  bottom: 28px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(12, 12, 14, 0.78);
  border: 1px solid rgba(199, 152, 100, 0.4);
  backdrop-filter: blur(8px);
  color: var(--gold);
  white-space: nowrap;
}

.hero-media-badge .badge-mark {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
}

.hero-media-badge .badge-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--gold) 70%, white);
  opacity: 0.85;
  flex: 0 0 auto;
}

.hero-media-badge .badge-tag {
  color: var(--body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1;
}

@keyframes glow-breathe {
  0%,
  100% {
    opacity: 0.65;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.04);
  }
}

.hero-copy {
  display: grid;
  gap: 18px;
  justify-items: start;
  padding-right: 24px;
}

.seo-name {
  margin: 0;
  color: var(--gold);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  line-height: 1.2;
}

.prompt {
  margin: 0;
  font-family: var(--mono);
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--cream);
  line-height: 1.15;
}

.prompt .gold {
  color: var(--gold);
  margin-right: 8px;
}

.typed {
  margin: 0;
  font-family: var(--mono);
  color: var(--green);
  font-size: clamp(14px, 1.5vw, 18px);
  min-height: 1.5em;
}

.typed .dim {
  color: #6f6f6f;
  margin-right: 8px;
}

.cursor {
  display: inline-block;
  width: 0.6em;
  height: 1em;
  margin-left: 2px;
  background: var(--green);
  vertical-align: text-bottom;
  animation: blink 1s steps(1) infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

.roles {
  margin: 4px 0 0;
  color: #f5f5f5;
  font-size: clamp(16px, 1.7vw, 20px);
  font-weight: 500;
}

.socials {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 10px;
}

.socials a {
  width: 46px;
  height: 46px;
  border-radius: 999px;
  border: 1.5px solid var(--gold);
  color: var(--gold);
  display: grid;
  place-items: center;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.socials a:hover,
.socials a:focus-visible {
  background: var(--gold);
  color: #1a140c;
  transform: translateY(-2px);
  outline: none;
}

.socials svg {
  width: 18px;
  height: 18px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .cursor {
    animation: none;
  }
}

.section-scroll {
  height: 100%;
  min-height: calc(100vh - 28px);
  overflow: auto;
  padding: 56px 48px 48px;
}

.section-title {
  margin: 0 0 36px;
  text-align: center;
  color: var(--cream);
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 800;
  letter-spacing: 0.04em;
}

.section-title::after {
  content: "";
  display: block;
  width: 54px;
  height: 3px;
  margin: 14px auto 0;
  background: var(--gold);
}

.about-grid {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 40px;
  align-items: start;
  max-width: 1080px;
  margin: 0 auto 56px;
}

.portrait {
  position: relative;
  padding: 18px 0 0 18px;
}

.portrait-offset {
  position: absolute;
  inset: 0 18px 18px 0;
  background: #101012;
  border-radius: 4px;
}

.portrait-frame {
  position: relative;
  min-height: 420px;
  border: 1px solid color-mix(in srgb, var(--gold) 70%, white);
  border-radius: 4px;
  background:
    radial-gradient(circle at 30% 20%, rgba(199, 152, 100, 0.35), transparent 45%),
    linear-gradient(160deg, #2a2118, #121214 55%, #0c0c0e);
  display: grid;
  place-items: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

.portrait-mark {
  font-size: clamp(72px, 10vw, 120px);
  font-weight: 800;
  letter-spacing: -0.06em;
  color: var(--gold);
  text-shadow: 0 0 40px rgba(199, 152, 100, 0.25);
}

.portrait-caption {
  position: absolute;
  bottom: 18px;
  left: 0;
  right: 0;
  margin: 0;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.about-copy h3 {
  margin: 0 0 18px;
  color: var(--gold);
  font-size: 22px;
  font-weight: 700;
}

.about-copy p {
  margin: 0 0 16px;
  color: var(--body);
  font-size: 15px;
  line-height: 1.75;
}

.experience-title {
  margin-top: 18px;
}

.exp-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  max-width: 1080px;
  margin: 0 auto 36px;
}

.exp-card {
  background: var(--card);
  border-radius: 10px;
  padding: 28px 18px;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.03);
}

.exp-icon {
  width: 42px;
  height: 42px;
  margin: 0 auto 16px;
  color: var(--gold);
}

.exp-icon svg {
  width: 100%;
  height: 100%;
}

.exp-card h4 {
  margin: 0;
  color: var(--cream);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
}

.skills {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px 28px;
  max-width: 980px;
  margin: 0 auto;
  padding: 28px 18px 12px;
  background-image: radial-gradient(rgba(255, 255, 255, 0.08) 0.8px, transparent 0.8px);
  background-size: 12px 12px;
  border-radius: 12px;
}

.skills div {
  color: #f2f2f2;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-align: center;
}

.skills div::after {
  content: "";
  display: block;
  width: 42px;
  height: 1px;
  margin: 10px auto 0;
  background: var(--gold);
}

.articles-lead {
  margin: -12px auto 28px;
  max-width: 720px;
  text-align: center;
  color: var(--muted);
  font-size: 15px;
}

.articles-list {
  display: grid;
  gap: 14px;
  max-width: 920px;
  margin: 0 auto;
}

.article-card {
  display: grid;
  gap: 8px;
  padding: 22px 24px;
  border-radius: 12px;
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.04);
  transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.article-card:hover {
  border-color: var(--gold);
  background: color-mix(in srgb, var(--card) 88%, var(--gold));
  transform: translateY(-2px);
}

.article-card time {
  color: var(--gold);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.04em;
}

.article-card h3 {
  margin: 0;
  color: var(--cream);
  font-size: clamp(16px, 2vw, 20px);
  font-weight: 700;
  line-height: 1.35;
}

.article-card p {
  margin: 0;
  color: var(--body);
  font-size: 14px;
  line-height: 1.6;
}

.article-open {
  margin-top: 4px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.articles-more {
  display: inline-flex;
  margin: 28px auto 0;
  color: var(--gold);
  font-weight: 700;
  letter-spacing: 0.04em;
  border-bottom: 1px solid transparent;
}

.articles-more:hover {
  border-bottom-color: var(--gold);
}

.section-scroll:has(.articles-list) {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.contact-wrap {
  display: flex;
  flex-direction: column;
}

.contact-grid {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 28px;
  max-width: 980px;
  margin: 0 auto;
  width: 100%;
  align-items: start;
}

.email-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 120px;
  padding: 24px;
  border: 1px solid var(--gold);
  border-radius: 8px;
  transition: background 0.2s ease;
}

.email-card:hover {
  background: rgba(199, 152, 100, 0.08);
}

.email-label {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.14em;
}

.email-value {
  margin: 0;
  color: var(--cream);
  font-size: clamp(13px, 3.6vw, 16px);
  font-weight: 600;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.4;
}

.email-card svg {
  width: 34px;
  height: 34px;
  color: var(--gold);
  flex-shrink: 0;
}

.contact-form {
  display: grid;
  gap: 12px;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  border: 0;
  border-radius: 6px;
  background: var(--card);
  color: var(--cream);
  padding: 14px 16px;
  outline: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.contact-form input:focus,
.contact-form textarea:focus {
  box-shadow: inset 0 0 0 1px var(--gold);
}

.contact-form textarea {
  resize: vertical;
  min-height: 140px;
}

.form-note {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.contact-form button {
  width: fit-content;
  min-width: 180px;
  height: 52px;
  border: 0;
  border-radius: 4px;
  background: var(--gold);
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: filter 0.2s ease, transform 0.2s ease;
}

.contact-form button:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
}

.form-status {
  margin: 0;
  color: var(--green);
  font-family: var(--mono);
  font-size: 13px;
}

.overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(10, 10, 12, 0.94);
  display: grid;
  place-items: center;
  backdrop-filter: blur(6px);
  padding: 96px 24px 40px;
  padding-top: max(96px, calc(env(safe-area-inset-top, 0px) + 88px));
  padding-bottom: max(40px, env(safe-area-inset-bottom, 0px));
}

.overlay[hidden] {
  display: none !important;
}

.overlay-nav {
  display: grid;
  gap: 8px;
  text-align: center;
  width: min(100%, 520px);
}

.overlay-nav a {
  font-size: clamp(32px, 8vw, 72px);
  font-weight: 800;
  letter-spacing: 0.02em;
  color: transparent;
  -webkit-text-stroke: 1.5px #fff;
  transition: color 0.2s ease, -webkit-text-stroke 0.2s ease;
  padding: 10px 12px;
  border-radius: 12px;
  -webkit-tap-highlight-color: transparent;
}

.overlay-nav a:hover,
.overlay-nav a:focus-visible {
  color: var(--gold);
  -webkit-text-stroke: 1.5px var(--gold);
  outline: none;
}

@media (max-width: 980px) {
  .ambient {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background: #0a0b0d;
  }

  .ambient-wash {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
      radial-gradient(ellipse 90% 60% at 18% 12%, rgba(199, 152, 100, 0.34), transparent 58%),
      radial-gradient(ellipse 75% 55% at 88% 78%, rgba(0, 255, 65, 0.14), transparent 52%),
      radial-gradient(circle at 50% 110%, rgba(0, 0, 0, 0.6), transparent 58%),
      linear-gradient(180deg, rgba(10, 11, 13, 0.08), rgba(10, 11, 13, 0.4));
  }

  body {
    background: #0a0b0d;
    background-image: none;
  }

  .frame {
    background: transparent;
  }

  .stage {
    background: rgba(14, 15, 18, 0.28);
    border: 1px solid rgba(199, 152, 100, 0.2);
    box-shadow:
      inset 0 0 0 1px rgba(255, 255, 255, 0.03),
      0 18px 50px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(5px);
  }

  .panel.is-active {
    background: transparent;
  }

  .hero,
  .about-grid,
  .contact-grid,
  .exp-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    padding: 64px 22px 40px;
    justify-items: center;
    gap: 22px;
    align-content: center;
  }

  .hero-media {
    display: block;
    width: min(100%, 520px);
    height: min(42vh, 320px);
    order: -1;
  }

  .hero-media-badge {
    left: 14px;
    bottom: 14px;
    gap: 8px;
    padding: 8px 12px;
  }

  .hero-media-badge .badge-mark {
    font-size: 15px;
  }

  .hero-media-badge .badge-tag {
    font-size: 11px;
    letter-spacing: 0.03em;
  }

  .hero-media-frame {
    inset: 10px;
  }

  .hero-copy {
    justify-items: center;
    text-align: center;
    padding: 0;
  }

  .socials {
    justify-content: center;
  }

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

  .section-scroll {
    padding: 72px 24px 40px;
  }
}

@media (max-width: 720px) {
  .frame {
    grid-template-columns: 1fr;
    padding: 10px;
    padding-top: max(10px, env(safe-area-inset-top, 0px));
    padding-bottom: max(10px, env(safe-area-inset-bottom, 0px));
    gap: 10px;
  }

  .rail {
    position: sticky;
    top: max(10px, env(safe-area-inset-top, 0px));
    z-index: 80;
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
    padding: 8px 12px;
    border-radius: 12px;
    gap: 12px;
    background: rgba(42, 42, 46, 0.94);
    backdrop-filter: blur(12px);
    box-shadow:
      inset 0 0 0 1px rgba(255, 255, 255, 0.04),
      0 10px 30px rgba(0, 0, 0, 0.28);
  }

  .logo {
    display: inline-block;
    font-size: 20px;
    margin-left: 2px;
  }

  .rail-copy {
    display: none;
  }

  .menu-btn {
    order: -1;
    width: 48px;
    height: 48px;
    flex: 0 0 auto;
  }

  .lang {
    position: fixed;
    top: max(18px, calc(env(safe-area-inset-top, 0px) + 14px));
    right: max(14px, env(safe-area-inset-right, 0px));
    z-index: 90;
  }

  body.menu-open .rail,
  body.menu-open .lang {
    z-index: 90;
  }

  body.menu-open .rail {
    background: rgba(42, 42, 46, 0.98);
  }

  .rail {
    padding-right: 96px; /* room for fixed TR/EN chrome */
  }

  .stage {
    min-height: calc(100dvh - 76px);
  }

  .panel,
  .section-scroll {
    min-height: calc(100dvh - 76px);
  }

  .section-scroll {
    padding: 64px 18px 36px;
    -webkit-overflow-scrolling: touch;
  }

  .exp-card,
  .article-card,
  .contact-form input,
  .contact-form textarea {
    background: rgba(32, 33, 38, 0.82);
    backdrop-filter: blur(6px);
  }

  .contact-form input,
  .contact-form textarea {
    font-size: 16px;
    min-height: 48px;
  }

  .contact-form button {
    width: 100%;
    min-width: 0;
  }

  .socials a {
    width: 48px;
    height: 48px;
  }

  .hero {
    min-height: auto;
    padding: 28px 16px 36px;
    gap: 18px;
  }

  .hero-media {
    height: min(36vh, 280px);
    border-radius: 18px;
  }

  .skills {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 18px 8px 8px;
  }

  .portrait {
    padding: 12px 0 0 12px;
  }

  .portrait-frame {
    min-height: 240px;
  }

  .prompt {
    font-size: clamp(22px, 7vw, 34px);
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  .roles {
    font-size: clamp(14px, 4.2vw, 18px);
    max-width: 22ch;
  }

  .overlay-nav {
    gap: 4px;
  }

  .overlay-nav a {
    font-size: clamp(28px, 9vw, 44px);
    padding: 14px 12px;
  }

  .article-card {
    padding: 18px 16px;
  }

  .articles-more {
    margin-bottom: 8px;
  }
}

@media (max-width: 380px) {
  .hero {
    padding: 24px 12px 32px;
  }

  .email-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .lang {
    right: 10px;
  }
}
