/* ============================================
   Javier Ferrer — Portfolio
   Minimal · Bold · Animated
   ============================================ */

:root {
  --bg: #e8e8e8;
  --bg-2: #dcdcdc;
  --ink: #1f1f1f;
  --ink-2: #2a2a2a;
  --muted: #5a5a5a;
  --accent: #1f1f1f;
  --yellow: #f5c518;
  --blue: #1454f0;
  --radius: 14px;
  --max: 1280px;
  --pad-x: clamp(1.25rem, 4vw, 5rem);
  --ease: cubic-bezier(.2, .7, .2, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

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

/* ============================================
   PERSISTENT BARS
   ============================================ */
.top-bar, .bottom-bar {
  position: fixed;
  left: 0; right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem var(--pad-x);
  font-size: 0.95rem;
  font-weight: 600;
  z-index: 50;
  pointer-events: none;
  mix-blend-mode: difference;
  color: #fff;
}

.top-bar { top: 0; }
.bottom-bar { bottom: 0; }

.presented-by { display: flex; flex-direction: column; line-height: 1.2; }
.presented-label { font-weight: 400; font-size: 0.85rem; opacity: 0.7; }
.presented-name { font-weight: 700; }

.page-indicator { font-weight: 700; font-feature-settings: "tnum"; }

.top-right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  pointer-events: auto;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  pointer-events: auto;
}
.lang-opt {
  background: transparent;
  border: 0;
  color: inherit;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  padding: 2px 2px;
  opacity: 0.4;
  letter-spacing: 0.04em;
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}
.lang-opt:hover { opacity: 0.8; transform: translateY(-1px); }
.lang-opt.is-active { opacity: 1; }
.lang-sep { opacity: 0.4; font-weight: 400; }
.page-indicator span {
  display: inline-block;
  min-width: 2em;
  transition: transform 0.4s var(--ease);
}

/* ============================================
   SIDE NAV DOTS
   ============================================ */
.side-nav {
  position: fixed;
  right: 1.5rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  z-index: 40;
}

.dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: rgba(31, 31, 31, 0.25);
  transition: all 0.35s var(--ease);
  display: block;
  position: relative;
}
.dot::after {
  content: attr(data-page);
  position: absolute;
  right: 22px;
  top: 50%;
  transform: translateY(-50%) translateX(8px);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--ink);
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
  transition: all 0.3s var(--ease);
}
.dot:hover { background: var(--ink); transform: scale(1.4); }
.dot:hover::after { opacity: 1; transform: translateY(-50%) translateX(0); }
.dot.active {
  background: var(--ink);
  transform: scale(1.5);
}

/* ============================================
   PROGRESS BAR
   ============================================ */
.progress-bar {
  position: fixed;
  left: 0; top: 0;
  height: 3px;
  width: 0%;
  background: var(--ink);
  z-index: 60;
  transition: width 0.1s linear;
}

/* ============================================
   SECTIONS
   ============================================ */
.section {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 6rem var(--pad-x);
  position: relative;
  overflow: hidden;
}

.container {
  max-width: var(--max);
  margin: 0 auto;
  width: 100%;
}

.two-col {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: clamp(2rem, 6vw, 6rem);
  align-items: center;
}

@media (max-width: 900px) {
  .two-col {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
}

/* ============================================
   TYPOGRAPHY
   ============================================ */
.display-hero {
  font-weight: 900;
  font-size: clamp(3rem, 11vw, 10rem);
  line-height: 0.95;
  letter-spacing: -0.04em;
  color: var(--ink);
}
.display-hero .line {
  display: block;
  overflow: hidden;
}

.display-h2 {
  font-weight: 900;
  font-size: clamp(2.5rem, 7.5vw, 6.5rem);
  line-height: 0.96;
  letter-spacing: -0.035em;
}
.display-h2 span { display: block; }
.display-h2 span.nowrap { white-space: nowrap; }

.subhead {
  margin-top: 1.5rem;
  font-size: clamp(1.05rem, 1.6vw, 1.4rem);
  font-weight: 700;
}

.lead {
  margin-top: 1rem;
  font-size: clamp(0.95rem, 1.1vw, 1.05rem);
  color: var(--ink-2);
  max-width: 56ch;
  line-height: 1.6;
}

.intro-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}
.intro-text {
  font-size: 0.98rem;
  color: var(--ink-2);
  line-height: 1.6;
}

/* ============================================
   REVEAL ANIMATIONS
   ============================================ */
.word.reveal {
  display: inline-block;
  transform: translateY(110%);
  transition: transform 1s var(--ease-out);
}
.section.is-visible .word.reveal { transform: translateY(0); }
.section.is-visible .word.reveal:nth-child(1) { transition-delay: 0.05s; }
.section.is-visible .word.reveal:nth-child(2) { transition-delay: 0.15s; }
.section.is-visible .line:nth-child(2) .word.reveal { transition-delay: 0.25s; }
.section.is-visible .line:nth-child(3) .word.reveal { transition-delay: 0.35s; }
.section.is-visible .line:nth-child(4) .word.reveal { transition-delay: 0.45s; }

.fade-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out);
}
.section.is-visible .fade-up { opacity: 1; transform: none; }
.delay-2 { transition-delay: 0.15s; }
.delay-3 { transition-delay: 0.3s; }
.delay-4 { transition-delay: 0.45s; }
.delay-5 { transition-delay: 0.6s; }

/* ============================================
   COVER
   ============================================ */
.cover { background: var(--bg); }
.cover .container { display: flex; flex-direction: column; justify-content: center; min-height: 70vh; }

.cover-scroll-hint {
  margin-top: 3rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.85rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--muted);
  opacity: 0;
  animation: fadeIn 1s var(--ease-out) 1.5s forwards;
}
.line-anim {
  width: 60px; height: 1px;
  background: var(--ink);
  position: relative;
  overflow: hidden;
}
.line-anim::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--bg);
  animation: scanX 2.4s var(--ease) infinite;
}

@keyframes fadeIn { to { opacity: 1; } }
@keyframes scanX {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* ============================================
   ABOUT — PHOTO
   ============================================ */
.col-side { display: flex; flex-direction: column; gap: 1.5rem; }

.photo-wrap {
  width: 100%;
  max-width: 360px;
  aspect-ratio: 4/3;
  overflow: hidden;
  border-radius: 6px;
  position: relative;
  background: var(--bg-2);
  transition: transform 0.6s var(--ease), box-shadow 0.6s var(--ease);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
}
.photo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  display: block;
  transition: transform 1.2s var(--ease-out);
}
.photo-wrap::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), transparent 50%);
  pointer-events: none;
}
.photo-wrap:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.15);
}
.photo-wrap:hover .photo-img { transform: scale(1.05); }

.intro-block { max-width: 360px; }

/* ============================================
   PROJECTS INTRO — Mosaic
   ============================================ */
.projects-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto;
  gap: 0.85rem;
  width: 100%;
  max-width: 720px;
  margin-left: auto;
}

.proj-tile {
  border-radius: var(--radius);
  padding: 1rem;
  position: relative;
  overflow: hidden;
  min-height: 160px;
  transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease);
}
.proj-tile:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 20px 50px rgba(0,0,0,0.18);
}

.proj-tile.img-tile {
  padding: 0;
  background: #f4f4f4;
  aspect-ratio: 16/10;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.proj-tile.img-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: transform 0.8s var(--ease-out);
}
.proj-tile.img-tile:hover img {
  transform: scale(1.05);
}

.proj-tile.dark { background: #1a1a1a; color: #eee; }
.proj-tile.blue { background: linear-gradient(160deg, #2050d0, #0d2a70); color: #fff; }

.chat-bubble {
  font-size: 0.55rem;
  line-height: 1.4;
  padding: 0.5rem 0.65rem;
  border-radius: 10px;
  margin-bottom: 0.4rem;
  max-width: 85%;
}
.chat-bubble.in { background: #2a2a2a; }
.chat-bubble.out { background: #3a3a3a; margin-left: auto; }
.chat-bubble.small { opacity: 0.7; }

.tile-label { font-size: 0.6rem; opacity: 0.7; margin-bottom: 0.25rem; }
.tile-label.light { font-size: 0.85rem; font-weight: 700; opacity: 1; margin-bottom: 0.5rem; }
.tile-amount { font-size: 1.1rem; font-weight: 700; margin-bottom: 0.5rem; }
.chart { width: 100%; height: 60px; }
.tile-stats { display: flex; justify-content: space-between; font-size: 0.55rem; margin-top: 0.5rem; opacity: 0.85; }
.tile-stats strong { display: block; font-size: 0.75rem; }
.dot-yellow { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--yellow); margin-right: 4px; }
.tile-mini { font-size: 0.55rem; opacity: 0.7; margin-bottom: 0.6rem; line-height: 1.4; }
.tile-btn {
  background: #fff; color: var(--blue);
  border: 0; border-radius: 6px;
  padding: 0.4rem 0.8rem;
  font-size: 0.7rem; font-weight: 700;
  cursor: pointer;
  transition: transform 0.3s var(--ease);
}
.tile-btn:hover { transform: scale(1.05); }

.proj-tile.cards {
  background: #f6f6f6;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.35rem;
  padding: 0.6rem;
}
.mini-card {
  aspect-ratio: 2/3;
  border-radius: 6px;
  background-size: cover;
  background-position: center;
}
.mini-card.silk    { background: linear-gradient(160deg, #2a3a5a, #0a1a3a); }
.mini-card.hades   { background: linear-gradient(160deg, #5a2a1a, #1a0a05); }
.mini-card.persona { background: linear-gradient(160deg, #c41a1a, #5a0505); }
.mini-card.death   { background: linear-gradient(160deg, #8a8a8a, #2a2a2a); }

/* ============================================
   HORNSTROMP — Phone Mockup
   ============================================ */
.phone-mockup {
  display: flex;
  justify-content: center;
  align-items: center;
  perspective: 1200px;
}
.phone-img {
  width: 100%;
  max-width: 320px;
  height: auto;
  display: block;
  filter: drop-shadow(0 30px 50px rgba(0, 0, 0, 0.25));
  transform: rotateY(-8deg) rotateX(2deg);
  transition: transform 0.8s var(--ease);
}
.phone-mockup:hover .phone-img {
  transform: rotateY(0) rotateX(0);
}
/* ============================================
   PACO GARCÍA — Layered composition
   ============================================ */
.paco-compo {
  position: relative;
  width: 100%;
  max-width: 560px;
  aspect-ratio: 1 / 1;
  transition: transform 0.6s var(--ease);
}
.paco-large {
  position: absolute;
  top: 0;
  right: 0;
  width: 88%;
  height: auto;
  border-radius: 10px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.18);
  transition: transform 0.6s var(--ease), box-shadow 0.6s var(--ease);
}
.paco-small {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 62%;
  height: auto;
  border-radius: 10px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.22);
  z-index: 2;
  transition: transform 0.6s var(--ease), box-shadow 0.6s var(--ease);
}
.paco-compo:hover .paco-large {
  transform: translate(4px, -4px);
  box-shadow: 0 28px 60px rgba(0, 0, 0, 0.22);
}
.paco-compo:hover .paco-small {
  transform: translate(-6px, 6px);
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.28);
}

/* ============================================
   WEB GAMES — Single mockup
   (also reused by additional project sections)
   ============================================ */
.webgames-mockup {
  width: 100%;
  max-width: 560px;
  aspect-ratio: 16/10;
  background: #f4f4f4;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.12);
  transition: transform 0.6s var(--ease), box-shadow 0.6s var(--ease);
}
.webgames-mockup img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.8s var(--ease-out);
}
.webgames-mockup:hover {
  transform: translateY(-6px);
  box-shadow: 0 28px 60px rgba(0, 0, 0, 0.18);
}
.webgames-mockup:hover img { transform: scale(1.04); }

/* ============================================
   EXPERIENCE
   ============================================ */
.skill-block { margin-bottom: 1.5rem; max-width: 460px; }
.skill-block h3 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  position: relative;
  padding-left: 14px;
}
.skill-block h3::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 4px; height: 70%;
  background: var(--ink);
  border-radius: 4px;
  transition: height 0.4s var(--ease);
}
.skill-block:hover h3::before { height: 100%; }
.skill-block p { color: var(--ink-2); font-size: 0.98rem; line-height: 1.55; }

/* ============================================
   TECH CHIPS
   ============================================ */
.tech-stack {
  display: flex; flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.5rem;
}
.tech-chip {
  background: rgba(31, 31, 31, 0.08);
  border: 1px solid rgba(31, 31, 31, 0.15);
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: default;
  user-select: none;
  -webkit-user-select: none;
  transition: all 0.3s var(--ease);
}
.tech-chip:hover {
  background: var(--ink);
  color: var(--bg);
  transform: translateY(-2px);
}

/* ============================================
   CONTACT
   ============================================ */
.contact-info {
  text-align: right;
  gap: 1.5rem;
}
.contact-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  position: relative;
  padding-right: 1rem;
  opacity: 0;
  transform: translateX(40px);
  background: none;
  border: 0;
  font-family: inherit;
  text-align: right;
  color: inherit;
  cursor: pointer;
  align-items: flex-end;
  transition:
    opacity 0.9s var(--ease-out),
    transform 0.9s var(--ease-out),
    padding-right 0.4s var(--ease);
}
.section.is-visible .contact-item {
  opacity: 1;
  transform: translateX(0);
}
.contact-item::before {
  content: '';
  position: absolute;
  right: 0;
  top: 50%;
  width: 0;
  height: 2px;
  background: var(--ink);
  transform: translateY(-50%);
  transition: width 0.45s var(--ease);
}
.contact-item:hover {
  padding-right: 1.75rem;
}
.contact-item:hover::before {
  width: 1rem;
}
.contact-item:hover .contact-value {
  letter-spacing: -0.01em;
}
.contact-label {
  font-size: 0.85rem;
  color: var(--muted);
  transition: color 0.4s var(--ease);
}
.contact-value {
  font-size: clamp(1rem, 1.3vw, 1.2rem);
  font-weight: 700;
  transition: letter-spacing 0.4s var(--ease);
}
.contact-item:hover .contact-label { color: var(--ink); }

@keyframes contactPulse {
  0%, 100% { transform: scaleY(1); }
  50% { transform: scaleY(1.5); }
}
.section.is-visible .contact-item:hover::before {
  animation: contactPulse 1.6s var(--ease) infinite;
}

@media (max-width: 900px) {
  .contact-info { text-align: left; }
  .contact-item:hover { transform: translateX(6px); }
}

/* ============================================
   BACK TO TOP — Inline at end of contact section
   ============================================ */
.contact { flex-direction: column; justify-content: center; }
.contact .container { width: 100%; }

.back-to-top-wrap {
  width: 100%;
  display: flex;
  justify-content: center;
  margin-top: 9rem;
}

.back-to-top {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.75rem 0.85rem 1.25rem;
  background: var(--ink);
  color: var(--bg);
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  border: 2px solid var(--ink);
  overflow: hidden;
  opacity: 0;
  transform: translateY(40px);
  transition:
    opacity 1s var(--ease-out),
    transform 1s var(--ease-out),
    background 0.45s var(--ease),
    color 0.45s var(--ease),
    box-shadow 0.5s var(--ease);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
}
.back-to-top.is-in-view {
  opacity: 1;
  transform: translateY(0);
}

.back-to-top-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg);
  color: var(--ink);
  transition: background 0.45s var(--ease), color 0.45s var(--ease), transform 0.5s var(--ease);
}
.back-to-top-arrow svg { width: 14px; height: 14px; }

.back-to-top:hover {
  background: var(--bg);
  color: var(--ink);
  transform: translateY(-4px);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.22);
}
.back-to-top:hover .back-to-top-arrow {
  background: var(--ink);
  color: var(--bg);
  transform: translateY(-3px);
}
.back-to-top:active { transform: translateY(-1px); }

@media (max-width: 900px) {
  .back-to-top-wrap { margin-top: 6rem; }
  .back-to-top { font-size: 0.85rem; padding: 0.7rem 1.4rem 0.7rem 1rem; }
}

/* ============================================
   RESPONSIVE TWEAKS
   ============================================ */
@media (max-width: 900px) {
  .top-bar, .bottom-bar { padding: 1rem var(--pad-x); font-size: 0.8rem; }
  .side-nav { right: 0.75rem; gap: 0.6rem; }
  .dot { width: 8px; height: 8px; }
  .section { padding: 5rem var(--pad-x); }
  .phone-img { max-width: 240px; }
  .photo-wrap { max-width: 100%; }
}

@media (max-width: 600px) {
  .display-hero { font-size: clamp(2.5rem, 14vw, 5rem); }
  .display-h2 { font-size: clamp(2rem, 11vw, 4rem); }
  .projects-grid { max-width: 100%; }
}

/* ============================================
   EMAIL MODAL — Portfolio-styled slide
   ============================================ */
.email-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.4s var(--ease), visibility 0s linear 0.4s;
}
.email-modal.is-open {
  visibility: visible;
  opacity: 1;
  transition: opacity 0.4s var(--ease);
}

.email-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 20, 20, 0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.email-modal-content {
  position: relative;
  background: var(--bg);
  border-radius: 4px;
  padding: clamp(1.75rem, 3vw, 2.75rem) clamp(1.75rem, 3vw, 3rem);
  width: 100%;
  max-width: 560px;
  max-height: calc(100vh - 3rem);
  overflow-y: auto;
  box-shadow:
    0 1px 0 rgba(0, 0, 0, 0.05),
    0 40px 100px rgba(0, 0, 0, 0.4);
  transform: translateY(40px) scale(0.97);
  opacity: 0;
  transition:
    transform 0.55s var(--ease-out),
    opacity 0.55s var(--ease-out);
  font-family: inherit;
}
.email-modal.is-open .email-modal-content {
  transform: translateY(0) scale(1);
  opacity: 1;
  transition-delay: 0.05s;
}

/* Top meta — mirror of the portfolio header */
.email-modal-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(31, 31, 31, 0.1);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink);
}
.email-modal-meta-right { font-feature-settings: "tnum"; }

/* Close button — same rotating X as before, repositioned over the bar */
.email-modal-close {
  position: absolute;
  top: 1.1rem;
  right: 1.1rem;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: transparent;
  border: 0;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
  transition: background 0.3s var(--ease), transform 0.4s var(--ease);
}
.email-modal-close:hover {
  background: var(--ink);
  color: var(--bg);
  transform: rotate(90deg);
}
.email-modal-close svg { width: 18px; height: 18px; }

/* Body */
.email-modal-body {
  padding: 1.75rem 0 1.5rem;
}

.email-modal-title {
  font-weight: 900;
  font-size: clamp(2.25rem, 5.5vw, 3.5rem);
  line-height: 0.95;
  letter-spacing: -0.035em;
  color: var(--ink);
}
.email-modal-title span { display: block; }

.email-modal-lead {
  margin-top: 1rem;
  font-size: 0.98rem;
  line-height: 1.55;
  color: var(--ink-2);
  max-width: 38ch;
}

/* Address card — like a tech-chip but bigger */
.email-modal-address-card {
  margin: 1.5rem 0 1.75rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 0.85rem 0.85rem 1.1rem;
  background: rgba(31, 31, 31, 0.06);
  border-left: 3px solid var(--ink);
  border-radius: 4px;
}
.email-modal-address-text {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  flex: 1;
  min-width: 0;
}
.email-modal-address-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--muted);
  font-weight: 600;
}
.email-modal-address-value {
  font-size: 1rem;
  font-weight: 700;
  font-feature-settings: "tnum";
  word-break: break-all;
  color: var(--ink);
}
.email-copy-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 6px;
  background: var(--ink);
  color: var(--bg);
  border: 0;
  cursor: pointer;
  transition: background 0.35s var(--ease), transform 0.35s var(--ease);
}
.email-copy-btn:hover { transform: translateY(-2px); }
.email-copy-btn:active { transform: translateY(0); }

.email-copy-icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
}
.email-copy-icon svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}
.email-copy-icon .icon-check { opacity: 0; transform: scale(0.6); }
.email-copy-btn.copied { background: #2a8a4a; }
.email-copy-btn.copied .icon-copy { opacity: 0; transform: scale(0.6); }
.email-copy-btn.copied .icon-check { opacity: 1; transform: scale(1); }

/* Options list */
.email-options {
  list-style: none;
  display: flex;
  flex-direction: column;
  padding: 0;
  margin: 0;
  border-top: 1px solid rgba(31, 31, 31, 0.1);
}
.email-options li {
  border-bottom: 1px solid rgba(31, 31, 31, 0.1);
}

.email-option {
  display: grid;
  grid-template-columns: 32px 28px 1fr 24px;
  align-items: center;
  gap: 1rem;
  width: 100%;
  padding: 1rem 0.25rem 1rem 0.25rem;
  background: transparent;
  border: 0;
  color: var(--ink);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
  text-decoration: none;
  position: relative;
  overflow: hidden;
  transition: color 0.4s var(--ease), padding-left 0.4s var(--ease);
}
.email-option::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--ink);
  transform: translateX(-100%);
  transition: transform 0.55s var(--ease-out);
  z-index: 0;
}
.email-option > * { position: relative; z-index: 1; }

.email-option:hover {
  color: var(--bg);
  padding-left: 0.85rem;
}
.email-option:hover::before { transform: translateX(0); }

.email-option-num {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  font-feature-settings: "tnum";
  transition: color 0.4s var(--ease);
}
.email-option:hover .email-option-num { color: rgba(255, 255, 255, 0.6); }

.email-option-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  color: var(--ink);
  transition: color 0.4s var(--ease);
}
.email-option-icon svg { width: 20px; height: 20px; }
.email-option:hover .email-option-icon { color: var(--bg); }

.email-option-label {
  font-size: 1.05rem;
  letter-spacing: -0.005em;
}

.email-option-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  color: var(--ink);
  transform: translateX(-4px);
  opacity: 0.5;
  transition: transform 0.45s var(--ease), opacity 0.45s var(--ease), color 0.4s var(--ease);
}
.email-option-arrow svg { width: 18px; height: 18px; }
.email-option:hover .email-option-arrow {
  transform: translateX(0);
  opacity: 1;
  color: var(--bg);
}

/* Copy success state */
.email-option.copied { color: var(--bg); padding-left: 0.85rem; }
.email-option.copied::before { transform: translateX(0); }
.email-option.copied .email-option-num { color: rgba(255, 255, 255, 0.6); }
.email-option.copied .email-option-icon,
.email-option.copied .email-option-arrow { color: var(--bg); }
.email-option.copied .email-option-arrow { transform: translateX(0); opacity: 1; }

/* Staggered entrance for option rows */
.email-modal.is-open .email-options li {
  animation: emailRowIn 0.55s var(--ease-out) both;
}
.email-modal.is-open .email-options li:nth-child(1) { animation-delay: 0.15s; }
.email-modal.is-open .email-options li:nth-child(2) { animation-delay: 0.22s; }
.email-modal.is-open .email-options li:nth-child(3) { animation-delay: 0.29s; }
.email-modal.is-open .email-options li:nth-child(4) { animation-delay: 0.36s; }
.email-modal.is-open .email-options li:nth-child(5) { animation-delay: 0.43s; }

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

/* Lock scroll when modal open */
body.modal-open { overflow: hidden; }

@media (max-width: 560px) {
  .email-option { grid-template-columns: 28px 24px 1fr 20px; gap: 0.75rem; }
  .email-option-label { font-size: 0.95rem; }
  .email-modal-title { font-size: clamp(1.9rem, 8vw, 2.6rem); }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .word.reveal { transform: none; }
  .fade-up { opacity: 1; transform: none; }
}
