/* --- Variables --- */
:root {
  --bg: #f4f0e8;
  --bg-elevated: #fffdf8;
  --text: #1a1614;
  --text-muted: #5c534c;
  --accent: #c41e3a;
  --accent-soft: rgba(196, 30, 58, 0.12);
  --border: rgba(26, 22, 20, 0.1);
  --shadow: rgba(26, 22, 20, 0.08);
  --font-sans: "Syne", system-ui, sans-serif;
  --font-serif: "Instrument Serif", Georgia, serif;
  --radius: 16px;
  --header-h: 72px;
}

[data-theme="dark"] {
  --bg: #0f0e0c;
  --bg-elevated: #1a1816;
  --text: #f0ebe4;
  --text-muted: #a89f94;
  --accent: #e85d6f;
  --accent-soft: rgba(232, 93, 111, 0.15);
  --border: rgba(240, 235, 228, 0.08);
  --shadow: rgba(0, 0, 0, 0.35);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  transition: background 0.35s ease, color 0.35s ease;
}

/* Opening animation — until intro finishes */
html:not(.page-loaded) {
  overflow: hidden;
}

html:not(.page-loaded) body {
  overflow: hidden;
}

.page-loader {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: grid;
  place-items: center;
  background: var(--bg);
  transition:
    opacity 0.65s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.75s cubic-bezier(0.4, 0, 0.2, 1),
    visibility 0s linear 0.8s;
}

.page-loader--exit {
  opacity: 0;
  transform: scale(1.04);
  visibility: hidden;
  pointer-events: none;
}

.page-loader__inner {
  text-align: center;
  padding: 2rem;
}

.page-loader__mark {
  display: block;
  font-family: var(--font-sans);
  font-size: clamp(3rem, 14vw, 5.5rem);
  font-weight: 800;
  letter-spacing: -0.06em;
  line-height: 1;
  color: var(--text);
  animation: loader-breathe 1.15s ease-in-out infinite alternate;
}

.page-loader__line {
  display: block;
  height: 3px;
  width: 0;
  max-width: 140px;
  margin: 1.35rem auto 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 60%, #e6b35a));
  animation: loader-line-grow 0.95s cubic-bezier(0.4, 0, 0.2, 1) 0.15s forwards;
}

.page-loader__hint {
  display: block;
  margin-top: 1.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--text-muted);
  opacity: 0;
  animation: loader-hint-in 0.5s ease 0.35s forwards;
}

@keyframes loader-breathe {
  from {
    opacity: 0.88;
    transform: scale(0.97);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes loader-line-grow {
  to {
    width: 100%;
  }
}

@keyframes loader-hint-in {
  to {
    opacity: 1;
  }
}

html:not(.page-loaded) main {
  opacity: 0;
  transform: translateY(10px);
}

html.page-loaded main {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.noise {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 9998;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

#bg-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.55;
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  min-height: var(--header-h);
  padding: 0.65rem clamp(1.25rem, 4vw, 2.5rem);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.logo {
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
  padding: 0.4rem 0.65rem;
  border-radius: 10px;
  background: var(--accent-soft);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.logo.logo--pop {
  animation: logo-pop 0.5s ease;
}

@keyframes logo-pop {
  0% {
    transform: scale(1) rotate(0deg);
  }
  40% {
    transform: scale(1.12) rotate(-6deg);
  }
  70% {
    transform: scale(1.08) rotate(4deg);
  }
  100% {
    transform: scale(1) rotate(0deg);
  }
}

.nav {
  display: flex;
  gap: clamp(0.75rem, 3vw, 1.75rem);
}

.nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  transition: color 0.2s;
}

.nav a:hover {
  color: var(--accent);
}

.menu-toggle {
  display: none;
  height: 44px;
  padding: 0 0.9rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
}

.menu-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.theme-toggle {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-elevated);
  cursor: pointer;
  color: var(--text);
  transition: border-color 0.2s, transform 0.15s;
}

.theme-toggle:hover {
  border-color: var(--accent);
}

.theme-toggle:active {
  transform: scale(0.96);
}

.theme-icon {
  grid-area: 1 / 1;
  font-size: 1.1rem;
  line-height: 1;
  transition: opacity 0.25s, transform 0.25s;
}

[data-theme="dark"] .theme-icon.sun {
  opacity: 0;
  transform: rotate(-90deg) scale(0.5);
}

[data-theme="light"] .theme-icon.moon,
:root:not([data-theme="dark"]) .theme-icon.moon {
  opacity: 0;
  transform: rotate(90deg) scale(0.5);
}

main {
  position: relative;
  z-index: 1;
  padding-top: var(--header-h);
}

/* --- Hero --- */
.hero {
  min-height: calc(100vh - var(--header-h));
  display: flex;
  flex-direction: column;
  padding: clamp(2rem, 6vw, 4rem) clamp(1.25rem, 4vw, 2.5rem) 4rem;
  max-width: 1040px;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
}

.hero-inner {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(200px, 300px) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 3.5rem);
  align-items: center;
  position: relative;
  z-index: 1;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(
      180deg,
      color-mix(in srgb, var(--bg) 92%, transparent) 0%,
      color-mix(in srgb, var(--bg) 72%, transparent) 42%,
      color-mix(in srgb, var(--bg-elevated) 55%, transparent) 100%
    ),
    url("background.jpg");
  background-size: cover;
  background-position: center;
  opacity: 1;
  filter: saturate(1.02) contrast(1.02);
  transform: scale(1.03);
  z-index: 0;
  pointer-events: none;
}

[data-theme="dark"] .hero::before {
  filter: saturate(1.06) contrast(1.06) brightness(0.62);
}

.hero-content {
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.22);
}

[data-theme="dark"] .hero-content {
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.45);
}

.hero-photo-wrap {
  position: relative;
  width: 100%;
  max-width: 300px;
  padding: 3px;
  border-radius: 28px;
  background: linear-gradient(135deg, #c9a227, var(--accent), #e6b35a);
  box-shadow: 0 18px 56px var(--shadow);
  overflow: hidden;
}

.hero-photo-frame {
  margin: 0;
  border-radius: 26px;
  overflow: hidden;
  background: var(--bg-elevated);
  aspect-ratio: 4 / 5;
  width: 100%;
}

.hero-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  opacity: 1;
  filter: blur(10px);
  transform-origin: top center;
  transform: perspective(900px) rotateX(82deg) scale(1.04);
  -webkit-clip-path: inset(0 0 100% 0);
  clip-path: inset(0 0 100% 0);
  will-change: clip-path, filter, transform;
}

html.page-loaded .hero-photo {
  animation: paper-fold-in 2s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

@keyframes paper-fold-in {
  0% {
    filter: blur(9px);
    transform: perspective(900px) rotateX(86deg) scale(1.045);
    -webkit-clip-path: inset(0 0 100% 0);
    clip-path: inset(0 0 100% 0);
  }
  20% {
    filter: blur(7px);
    transform: perspective(900px) rotateX(58deg) scale(1.02);
    -webkit-clip-path: inset(0 0 70% 0);
    clip-path: inset(0 0 70% 0);
  }
  55% {
    filter: blur(3px);
    transform: perspective(900px) rotateX(18deg) scale(1.008);
    -webkit-clip-path: inset(0 0 25% 0);
    clip-path: inset(0 0 25% 0);
  }
  80% {
    filter: blur(1px);
    transform: perspective(900px) rotateX(8deg) scale(1.003);
    -webkit-clip-path: inset(0 0 8% 0);
    clip-path: inset(0 0 8% 0);
  }
  100% {
    filter: blur(0px);
    transform: perspective(900px) rotateX(0deg) scale(1);
    -webkit-clip-path: inset(0 0 0 0);
    clip-path: inset(0 0 0 0);
  }
}

.reveal.visible .hero-photo {
  /* Fallback in case intro reveals before page-loaded */
  opacity: 1;
}

.hero-content {
  min-width: 0;
}

@media (max-width: 768px) {
  .hero-inner {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .hero-photo-wrap {
    max-width: 260px;
    margin: 0 auto;
  }

  /* Phone fix: remove white gaps, fit photo to border */
  .hero-photo-frame {
    aspect-ratio: auto;
  }

  .hero-photo {
    width: 100%;
    height: auto;
    object-fit: cover;
    object-position: center;
    background: transparent;
  }

  .hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .hero-lead {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-actions {
    justify-content: center;
  }
}

/* Phone navigation: menu dropdown */
@media (max-width: 680px) {
  .menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .nav {
    display: none;
    width: 100%;
    order: 10;
    padding: 0.5rem 0.75rem;
    border-radius: 14px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    box-shadow: 0 12px 40px var(--shadow);
  }

  .nav.nav--open {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
  }

  .nav a {
    padding: 0.6rem 0.55rem;
    border-radius: 10px;
  }

  .nav a:hover {
    background: var(--accent-soft);
  }
}

.hero-kicker {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 1rem;
}

.hero-title {
  margin: 0 0 1.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
}

.hero-title .line {
  display: block;
}

.hero-title .line:first-child {
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.hero-title .name {
  font-family: var(--font-serif);
  font-size: clamp(2.75rem, 9vw, 4.25rem);
  font-weight: 400;
  font-style: italic;
}

.hero-lead {
  max-width: 34rem;
  margin: 0 0 2rem;
  color: var(--text-muted);
  font-size: 1.1rem;
}

.hero-lead strong {
  color: var(--text);
  font-weight: 600;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.35rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.2s;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 20px var(--accent-soft);
}

.btn-primary:hover {
  box-shadow: 0 6px 28px var(--accent-soft);
}

.btn-ghost {
  border: 1px solid var(--border);
  color: var(--text);
  background: var(--bg-elevated);
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.scroll-hint {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: auto;
  padding-top: 3rem;
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
  position: relative;
  z-index: 1;
}

.scroll-line {
  width: 48px;
  height: 1px;
  background: linear-gradient(90deg, var(--accent), transparent);
}

/* --- Sections --- */
.section {
  padding: clamp(3rem, 8vw, 5.5rem) clamp(1.25rem, 4vw, 2.5rem);
}

.section-inner {
  max-width: 800px;
  margin: 0 auto;
}

.section-title {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 5vw, 2.75rem);
  font-weight: 400;
  font-style: italic;
  margin: 0 0 2rem;
  letter-spacing: -0.02em;
}

.about-grid {
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 640px) {
  .about-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.about-card {
  padding: 1.5rem 1.65rem;
  border-radius: var(--radius);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  box-shadow: 0 8px 32px var(--shadow);
}

.about-card h3 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent);
}

.about-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.98rem;
}

.about-card strong {
  color: var(--text);
}

/* Timeline */
.education {
  background: color-mix(in srgb, var(--accent) 4%, var(--bg));
}

.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 11px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: linear-gradient(180deg, var(--accent), var(--border));
}

.timeline-item {
  position: relative;
  padding-left: 2.75rem;
  margin-bottom: 2rem;
}

.timeline-item:last-child {
  margin-bottom: 0;
}

.timeline-dot {
  position: absolute;
  left: 4px;
  top: 6px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 3px solid var(--accent);
  box-shadow: 0 0 0 4px var(--bg);
}

.timeline-content {
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
}

.timeline-label {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.timeline-label.current {
  color: var(--accent);
}

.timeline-content h3 {
  margin: 0 0 0.5rem;
  font-size: 1.15rem;
}

.timeline-content p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Interests */
.interests-intro {
  font-size: clamp(1.1rem, 2.5vw, 1.35rem);
  margin: 0 0 1.5rem;
  color: var(--text-muted);
}

.typed-wrap {
  color: var(--text);
  font-weight: 600;
}

.cursor {
  animation: blink 1s step-end infinite;
  color: var(--accent);
}

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

.skills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.skill-pill {
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  background: var(--accent-soft);
  color: var(--text);
  border: 1px solid var(--border);
}

.code-window {
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #1e1c1a;
  box-shadow: 0 16px 48px var(--shadow);
}

.code-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1rem;
  background: #2a2724;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.code-header .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #5c534c;
}

.code-header .dot:nth-child(1) {
  background: #e85d6f;
}
.code-header .dot:nth-child(2) {
  background: #e6b35a;
}
.code-header .dot:nth-child(3) {
  background: #6bcf7f;
}

.code-title {
  margin-left: auto;
  font-size: 0.75rem;
  color: #8a8278;
  font-family: ui-monospace, monospace;
}

.code-body {
  margin: 0;
  padding: 1.25rem 1.35rem;
  overflow-x: auto;
  font-family: "Consolas", "Monaco", ui-monospace, monospace;
  font-size: 0.82rem;
  line-height: 1.6;
  color: #d4cfc6;
}

.code-body .kw {
  color: #e85d6f;
}
.code-body .key {
  color: #9ad4ff;
}
.code-body .str {
  color: #9bcf8f;
}
.code-body .fn {
  color: #e6b35a;
}

/* Coding playground + ideas */
.code-playground {
  padding: 1rem 1.35rem 1.25rem;
  background: rgba(0, 0, 0, 0.18);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.playground-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.playground-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #9a938a;
  white-space: nowrap;
}

.playground-input {
  flex: 1;
  min-width: 160px;
  padding: 0.65rem 0.85rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: #f3eee7;
  font-family: inherit;
  font-size: 0.95rem;
}

.playground-input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.btn-run {
  padding: 0.6rem 1rem;
}

.terminal {
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(0, 0, 0, 0.25);
  padding: 0.85rem 0.95rem;
}

.terminal-title {
  font-family: ui-monospace, monospace;
  font-size: 0.8rem;
  color: #9a938a;
  margin-bottom: 0.4rem;
}

.terminal-body {
  margin: 0;
  font-family: "Consolas", "Monaco", ui-monospace, monospace;
  font-size: 0.9rem;
  line-height: 1.6;
  color: #efe8e0;
  white-space: pre-wrap;
}

.terminal-dim {
  color: #7f7a73;
}

.project-ideas {
  margin-top: 1.25rem;
}

.ideas-title {
  margin: 0 0 0.9rem;
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 500;
}

.ideas-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 640px) {
  .ideas-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.idea-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
}

.idea-card summary {
  cursor: pointer;
  font-weight: 800;
  color: var(--accent);
}

.idea-card summary::-webkit-details-marker {
  display: none;
}

.idea-card p {
  margin: 0.65rem 0 0;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* Quick facts — flip cards (red accent, matches site) */
.quick-facts {
  background: color-mix(in srgb, var(--accent) 4%, var(--bg));
  border-radius: var(--radius);
}

.quick-facts-lead {
  margin: -0.5rem 0 1.5rem;
  color: var(--text-muted);
  font-size: 1rem;
}

.flip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem;
}

.quick-facts .flip-card {
  min-height: 188px;
  perspective: 1100px;
  outline: none;
}

.quick-facts .flip-card:focus-visible {
  border-radius: var(--radius);
  box-shadow: 0 0 0 3px var(--accent-soft), 0 0 0 5px var(--accent);
}

.flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 188px;
  transition: transform 0.65s cubic-bezier(0.4, 0, 0.2, 1);
  transform-style: preserve-3d;
}

.quick-facts .flip-card:hover .flip-card-inner,
.quick-facts .flip-card:focus-within .flip-card-inner {
  transform: rotateY(180deg);
}

.quick-facts .flip-card-front,
.quick-facts .flip-card-back {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  border-radius: var(--radius);
  padding: 1.35rem 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  border: 1px solid var(--border);
}

.quick-facts .flip-card-front {
  background: var(--bg-elevated);
  box-shadow: 0 8px 28px var(--shadow);
  gap: 0.65rem;
}

.quick-facts .flip-card-back {
  background: linear-gradient(145deg, var(--accent-soft), var(--bg-elevated));
  transform: rotateY(180deg);
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--text-muted);
}

.quick-facts .flip-card-back p {
  margin: 0;
}

.quick-facts .flip-icon {
  font-size: 2rem;
  line-height: 1;
}

.quick-facts .flip-label {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
}

/* Contact */
.contact-lead {
  margin: 0 0 1rem;
  color: var(--text-muted);
  font-size: 1.05rem;
}

.contact-email {
  display: inline-block;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  padding: 0.65rem 1.1rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.contact-email:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 20px var(--accent-soft);
}

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

.contact-email-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.btn-copy {
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-muted);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.btn-copy:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-copy:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.contact-social-label {
  margin: 1.75rem 0 0.75rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.social-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.2s, color 0.2s, transform 0.15s, box-shadow 0.2s;
}

.social-link:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--shadow);
}

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

.social-icon {
  flex-shrink: 0;
}

.social-links--footer {
  justify-content: center;
  margin-bottom: 1.15rem;
}

.social-links--footer .social-link {
  width: 44px;
  height: 44px;
  border-radius: 12px;
}

.closing {
  text-align: center;
}

.quote {
  margin: 0 auto 1rem;
  max-width: 28rem;
  font-family: var(--font-serif);
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  font-style: italic;
  line-height: 1.45;
  color: var(--text-muted);
}

.closing-note {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.quote-shuffle {
  display: inline-flex;
  margin: 0.75rem auto 0;
  padding: 0.45rem 1rem;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  background: transparent;
  border: 1px dashed var(--border);
  border-radius: 999px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.quote-shuffle:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.quote-shuffle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  z-index: 10000;
  padding: 0.75rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 12px 40px var(--shadow);
  transform: translate(-50%, 120%);
  opacity: 0;
  transition: transform 0.35s ease, opacity 0.35s ease;
  pointer-events: none;
}

.toast.toast--visible {
  transform: translate(-50%, 0);
  opacity: 1;
}

.site-footer {
  position: relative;
  z-index: 1;
  padding: 2rem clamp(1.25rem, 4vw, 2.5rem) 2.5rem;
  text-align: center;
  border-top: 1px solid var(--border);
}

.site-footer p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer-time {
  margin-bottom: 0.65rem !important;
  font-variant-numeric: tabular-nums;
}

.footer-time-label {
  color: var(--text-muted);
  margin-right: 0.35rem;
}

.footer-time #kathmandu-time {
  font-weight: 600;
  color: var(--text);
}

.footer-mail {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.footer-mail:hover {
  text-decoration: underline;
}

.footer-mail:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  html:not(.page-loaded) main {
    opacity: 1;
    transform: none;
  }
  html.page-loaded main {
    transition: none;
    opacity: 1;
    transform: none;
  }
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .cursor {
    animation: none;
  }
  .hero-photo-wrap {
    animation: none;
    background: var(--bg-elevated);
  }
  .hero-photo {
    filter: none;
    transform: none;
    transition: none;
    opacity: 1;
    -webkit-clip-path: inset(0 0 0 0);
    clip-path: inset(0 0 0 0);
  }
  .flip-card-inner {
    min-height: auto;
    transition: none;
    display: flex;
    flex-direction: column;
    gap: 0;
  }
  .flip-card:hover .flip-card-inner,
  .flip-card:focus-within .flip-card-inner {
    transform: none;
  }
  .flip-card-front,
  .flip-card-back {
    position: relative;
    inset: auto;
    transform: none !important;
    backface-visibility: visible;
  }
  .flip-card-back {
    margin-top: 0.75rem;
    min-height: auto;
  }
  .flip-card {
    min-height: auto;
  }
  .logo.logo--pop {
    animation: none;
  }
  .page-loader,
  .page-loader__mark,
  .page-loader__line,
  .page-loader__hint {
    animation: none !important;
  }
  .page-loader__line {
    width: 100%;
  }
  html:not(.page-loaded) main {
    opacity: 1;
    transform: none;
  }
}
