:root {
  --bg: #07101c;
  --bg-elevated: #0d1a2b;
  --ink: #f2efe8;
  --muted: #9aabbc;
  --amber: #e4a04a;
  --amber-soft: rgba(228, 160, 74, 0.18);
  --teal: #4ea0b5;
  --line: rgba(242, 239, 232, 0.12);
  --font-display: "Bricolage Grotesque", Georgia, serif;
  --font-body: "Figtree", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "Cascadia Code", Consolas, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --max: 1120px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--ink);
  background: linear-gradient(180deg, #08111f 0%, var(--bg) 35%, #050b14 100%);
  overflow-x: hidden;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

.grain {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 50;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Header */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.1rem clamp(1.25rem, 4vw, 2.5rem);
  background: linear-gradient(180deg, rgba(7, 16, 28, 0.85), rgba(7, 16, 28, 0));
  backdrop-filter: blur(0px);
  transition: background 0.4s var(--ease), backdrop-filter 0.4s var(--ease);
}

.site-header.is-scrolled {
  background: rgba(7, 16, 28, 0.78);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.nav {
  display: flex;
  gap: 1.5rem;
}

.nav a {
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.25s var(--ease);
}

.nav a:hover {
  color: var(--ink);
}

.nav-cta {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--bg);
  background: var(--amber);
  padding: 0.55rem 1rem;
  border-radius: 999px;
  transition: transform 0.25s var(--ease), background 0.25s var(--ease);
}

.nav-cta:hover {
  transform: translateY(-1px);
  background: #f0b35d;
}

/* Hero */
.hero {
  position: relative;
  padding: 7.5rem 0 3rem;
}

.hero-panel {
  position: relative;
  z-index: 2;
  width: min(var(--max), calc(100% - 2.5rem));
  margin: 0 auto;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.35rem 1.75rem;
  align-items: center;
}

.hero-avatar-wrap {
  width: fit-content;
}

.hero-avatar {
  width: clamp(120px, 18vw, 176px);
  height: clamp(120px, 18vw, 176px);
  border-radius: 50%;
  object-fit: cover;
  object-position: center 18%;
  border: 3px solid rgba(228, 160, 74, 0.45);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
  opacity: 0;
  transform: translateY(18px) scale(0.96);
  animation: riseIn 0.9s var(--ease) 0.1s forwards;
}

.hero-content {
  min-width: 0;
  padding-bottom: 0.35rem;
}

.hero-brand {
  margin: 0 0 0.55rem;
  font-family: var(--font-display);
  font-size: clamp(2rem, 5.5vw, 3.6rem);
  font-weight: 800;
  line-height: 0.98;
  letter-spacing: -0.04em;
  color: var(--ink);
  text-wrap: balance;
  opacity: 0;
  transform: translateY(28px);
  animation: riseIn 1s var(--ease) 0.2s forwards;
}

.hero h1 {
  margin: 0 0 0.85rem;
  max-width: 24ch;
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 2.4vw, 1.55rem);
  font-weight: 500;
  line-height: 1.35;
  color: var(--amber);
  opacity: 0;
  transform: translateY(24px);
  animation: riseIn 1s var(--ease) 0.35s forwards;
}

.hero-lead {
  margin: 0 0 1.35rem;
  max-width: 38ch;
  color: var(--muted);
  font-size: 1.05rem;
  opacity: 0;
  transform: translateY(24px);
  animation: riseIn 1s var(--ease) 0.5s forwards;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  opacity: 0;
  transform: translateY(24px);
  animation: riseIn 1s var(--ease) 0.65s forwards;
}

.hero-terminal {
  width: min(var(--max), calc(100% - 2.5rem));
  margin: 2rem auto 0;
  opacity: 0;
  transform: translateY(20px);
  animation: riseIn 1s var(--ease) 0.8s forwards;
}

/* Terminal */
.terminal-window {
  position: relative;
  border: 1px solid rgba(95, 214, 138, 0.22);
  border-radius: 14px;
  background: rgba(4, 10, 18, 0.92);
  box-shadow:
    0 24px 48px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(242, 239, 232, 0.04);
  overflow: hidden;
}

.terminal-header {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.65rem 0.9rem;
  border-bottom: 1px solid var(--line);
  background: rgba(7, 16, 28, 0.85);
}

.terminal-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.terminal-dot.is-red {
  background: #ff5f57;
}

.terminal-dot.is-yellow {
  background: #febc2e;
}

.terminal-dot.is-green {
  background: #28c840;
}

.terminal-title {
  margin-left: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.terminal-body {
  position: relative;
  min-height: 220px;
  max-height: 280px;
  padding: 1rem 1.1rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.65;
  color: #c8facc;
  overflow: hidden;
}

.boot-terminal .terminal-body {
  min-height: 260px;
  max-height: 320px;
}

.terminal-log {
  display: grid;
  gap: 0.15rem;
  margin-bottom: 0.65rem;
  max-height: 200px;
  overflow: hidden;
}

.boot-terminal .terminal-log {
  max-height: 280px;
}

.terminal-line {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.terminal-line.is-command {
  color: var(--ink);
}

.terminal-line.is-output {
  color: #8fd6ff;
  padding-left: 0.2rem;
}

.terminal-line.is-success {
  color: #5fd68a;
}

.terminal-line.is-muted {
  color: var(--muted);
}

.terminal-active-line {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 1.65em;
}

.terminal-prompt {
  color: var(--amber);
  font-weight: 700;
}

.terminal-typed {
  color: var(--ink);
  white-space: pre-wrap;
  word-break: break-word;
}

.terminal-cursor {
  display: inline-block;
  width: 0.55em;
  height: 1.05em;
  background: #5fd68a;
  box-shadow: 0 0 10px rgba(95, 214, 138, 0.65);
  animation: cursorBlink 1s step-end infinite;
  vertical-align: middle;
}

.terminal-scanline {
  pointer-events: none;
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0) 0,
    rgba(0, 0, 0, 0) 2px,
    rgba(0, 0, 0, 0.06) 3px
  );
  opacity: 0.35;
  animation: scanMove 8s linear infinite;
}

@keyframes cursorBlink {
  0%,
  49% {
    opacity: 1;
  }

  50%,
  100% {
    opacity: 0;
  }
}

@keyframes scanMove {
  from {
    transform: translateY(0);
  }

  to {
    transform: translateY(12px);
  }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.9rem;
  padding: 0.7rem 1.25rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform 0.25s var(--ease), background 0.25s var(--ease), border-color 0.25s var(--ease);
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  background: var(--amber);
  color: #101820;
}

.btn-primary:hover {
  background: #f0b35d;
}

.btn-ghost {
  border: 1px solid var(--line);
  background: rgba(242, 239, 232, 0.04);
  color: var(--ink);
}

.btn-ghost:hover {
  border-color: rgba(242, 239, 232, 0.28);
}

/* Sections */
.section {
  padding: clamp(4.5rem, 10vw, 7rem) 0;
}

.section-inner {
  width: min(var(--max), calc(100% - 2.5rem));
  margin: 0 auto;
}

.eyebrow {
  margin: 0 0 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--teal);
}

.section h2 {
  margin: 0 0 1.75rem;
  max-width: 18ch;
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 4.2vw, 3rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.about-grid {
  display: grid;
  gap: 1.25rem 2.5rem;
}

@media (min-width: 800px) {
  .about-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.about-text {
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.about-text-full {
  margin-top: 1.75rem;
  max-width: 72ch;
}

.boot-terminal {
  align-self: start;
}

.split .section-inner {
  display: grid;
  gap: 3.5rem;
}

@media (min-width: 860px) {
  .split .section-inner {
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
  }
}

.split-block h2 {
  margin-bottom: 1.5rem;
}

.timeline-item {
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}

.timeline-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 1rem;
  margin-bottom: 0.55rem;
  font-size: 0.88rem;
}

.status-dot {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #5fd68a;
  box-shadow: 0 0 0 0 rgba(95, 214, 138, 0.55);
  animation: statusPulse 2.2s ease-in-out infinite;
}

@keyframes statusPulse {
  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(95, 214, 138, 0.55);
  }

  50% {
    transform: scale(1.15);
    box-shadow: 0 0 0 7px rgba(95, 214, 138, 0);
  }
}

.timeline-role {
  color: var(--amber);
  font-weight: 600;
}

.timeline-date {
  color: var(--muted);
}

.timeline-item h3 {
  margin: 0 0 0.55rem;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.timeline-item p {
  margin: 0;
  color: var(--muted);
}

/* Contact */
.contact {
  background: none;
}

.contact-intro h2 {
  max-width: none;
}

.contact-lead {
  margin: -0.75rem 0 0;
  max-width: 36ch;
  color: var(--muted);
}

.contact-layout {
  display: grid;
  gap: 2rem;
  margin-top: 2rem;
}

@media (min-width: 900px) {
  .contact-layout {
    grid-template-columns: minmax(260px, 0.9fr) minmax(0, 1.4fr);
    align-items: start;
    gap: 2.5rem;
  }
}

.contact-links {
  display: grid;
  gap: 0;
  max-width: none;
}

.contact-link {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  width: 100%;
  padding: 1rem 0;
  color: var(--ink);
  background: none;
  border: 0;
  border-top: 1px solid var(--line);
  text-align: left;
  cursor: pointer;
  font: inherit;
  transition: color 0.25s var(--ease), padding-left 0.25s var(--ease), background 0.25s var(--ease);
}

.contact-link:last-child {
  border-bottom: 1px solid var(--line);
}

.contact-link:hover,
.contact-link.is-active {
  padding-left: 0.4rem;
}

.contact-link.is-active {
  background: rgba(242, 239, 232, 0.03);
}

.contact-link.is-active .contact-value,
.contact-link:hover .contact-value {
  color: var(--amber);
}

.contact-label {
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--teal);
  font-weight: 600;
}

.contact-value {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  transition: color 0.25s var(--ease);
  word-break: break-word;
}

.contact-panel {
  min-height: 420px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(13, 26, 43, 0.55);
  overflow: hidden;
}

.contact-panel-view {
  display: none;
  height: 100%;
  min-height: 420px;
  padding: 1.35rem;
}

.contact-panel-view.is-visible {
  display: flex;
  flex-direction: column;
}

.panel-title {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.panel-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.85rem;
}

.panel-toolbar .panel-title {
  margin: 0;
}

.contact-link-external {
  position: relative;
  padding-right: 1.5rem;
  text-decoration: none;
}

.contact-link-external::after {
  content: "↗";
  position: absolute;
  top: 1.05rem;
  right: 0;
  font-size: 0.95rem;
  color: var(--muted);
}

.contact-link-external:hover::after {
  color: var(--amber);
}

.panel-loading,
.panel-error {
  margin: 0;
  color: var(--muted);
}

.panel-error {
  color: #f08a8a;
}

.github-header {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1.25rem;
}

.github-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 2px solid var(--line);
}

.github-meta h3 {
  margin: 0 0 0.25rem;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
}

.github-meta p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.github-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  margin-bottom: 1.25rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
}

.github-stats strong {
  color: var(--ink);
}

.github-repos-title {
  margin: 0 0 0.85rem;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--teal);
}

.github-repos {
  display: grid;
  gap: 0.65rem;
  max-height: 220px;
  overflow: auto;
  padding-right: 0.25rem;
}

.github-repo {
  display: block;
  padding: 0.85rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(7, 16, 28, 0.45);
  transition: border-color 0.25s var(--ease), transform 0.25s var(--ease);
}

.github-repo:hover {
  border-color: rgba(228, 160, 74, 0.45);
  transform: translateY(-1px);
}

.github-repo strong {
  display: block;
  margin-bottom: 0.2rem;
  color: var(--amber);
  font-size: 0.98rem;
}

.github-repo span {
  color: var(--muted);
  font-size: 0.88rem;
}

.github-open {
  margin-top: 1rem;
}

.mail-form {
  display: grid;
  gap: 0.9rem;
}

.form-field {
  display: grid;
  gap: 0.35rem;
}

.form-field span {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.form-field input,
.form-field textarea {
  width: 100%;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(7, 16, 28, 0.65);
  color: var(--ink);
  font: inherit;
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.form-field input:focus,
.form-field textarea:focus {
  outline: none;
  border-color: rgba(228, 160, 74, 0.55);
  box-shadow: 0 0 0 3px rgba(228, 160, 74, 0.12);
}

.form-field textarea {
  resize: vertical;
  min-height: 120px;
}

.form-honeypot {
  position: absolute;
  left: -9999px;
  opacity: 0;
  pointer-events: none;
}

.form-status {
  margin: 0;
  min-height: 1.25rem;
  font-size: 0.92rem;
  color: var(--muted);
}

.form-status.is-success {
  color: #5fd68a;
}

.form-status.is-error {
  color: #f08a8a;
}

@media (max-width: 899px) {
  .contact-panel {
    min-height: 360px;
  }

  .contact-panel-view {
    min-height: 360px;
  }
}

.site-footer {
  padding: 1.5rem clamp(1.25rem, 4vw, 2.5rem) 2.5rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.easter-egg-toast {
  position: fixed;
  left: 50%;
  bottom: 2rem;
  z-index: 60;
  translate: -50% 120%;
  padding: 0.85rem 1.2rem;
  border: 1px solid rgba(228, 160, 74, 0.45);
  border-radius: 999px;
  background: rgba(7, 16, 28, 0.94);
  color: var(--amber);
  font-family: var(--font-mono);
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
  transition: translate 0.45s var(--ease), opacity 0.45s var(--ease);
  opacity: 0;
  pointer-events: none;
}

.easter-egg-toast.is-visible {
  translate: -50% 0;
  opacity: 1;
}

.hero-avatar-wrap.is-wiggle {
  animation: avatarWiggle 0.5s var(--ease);
}

@keyframes avatarWiggle {
  0%,
  100% {
    transform: rotate(0deg);
  }

  20% {
    transform: rotate(-6deg);
  }

  40% {
    transform: rotate(5deg);
  }

  60% {
    transform: rotate(-4deg);
  }

  80% {
    transform: rotate(3deg);
  }
}

/* Reveal on scroll */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

@keyframes riseIn {
  to {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 720px) {
  .nav {
    display: none;
  }

  .hero {
    padding-top: 6.5rem;
  }

  .hero-panel {
    gap: 0.9rem 1rem;
  }

  .hero-content {
    display: contents;
  }

  .hero-brand,
  .hero h1 {
    grid-column: 2;
  }

  .hero-brand {
    font-size: clamp(1.7rem, 8vw, 2.4rem);
  }

  .hero-lead,
  .hero-actions {
    grid-column: 1 / -1;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .hero-avatar,
  .hero-brand,
  .hero h1,
  .hero-lead,
  .hero-actions,
  .hero-terminal,
  .status-dot,
  .terminal-cursor,
  .terminal-scanline,
  .reveal {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}
