/* ---------- FONTS ---------- */
/* ESBuild — sans-serif (body / UI) */
@font-face {
  font-family: "ESBuild";
  src: url("ESBuildTRIAL-Regular.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "ESBuild";
  src: url("ESBuildTRIAL-Italic.otf") format("opentype");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "ESBuild";
  src: url("ESBuildTRIAL-Medium.otf") format("opentype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "ESBuild";
  src: url("ESBuildTRIAL-MediumItalic.otf") format("opentype");
  font-weight: 500;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "ESBuild";
  src: url("ESBuildTRIAL-Semibold.otf") format("opentype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "ESBuild";
  src: url("ESBuildTRIAL-SemiboldItalic.otf") format("opentype");
  font-weight: 600;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "ESBuild";
  src: url("ESBuildTRIAL-Bold.otf") format("opentype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "ESBuild";
  src: url("ESBuildTRIAL-BoldItalic.otf") format("opentype");
  font-weight: 700;
  font-style: italic;
  font-display: swap;
}

:root {
  --bg: #0a0a0a;
  --cream: #f7f4e9;
  --muted: #9a9a9a;
  --bubble-sent: #f7f4e9;
  --bubble-recv: #2f2f2f;
}

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

html, body {
  background: var(--bg);
  color: #fff;
  font-family: "ESBuild", "Inter", -apple-system, system-ui, sans-serif;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.hero {
  position: relative;
  max-width: 1320px;
  margin: 0 auto;
  min-height: calc(100vh - 100px);
  padding: 24px 56px 48px;
  display: grid;
  grid-template-columns: 1fr 420px;
  align-items: center;
  gap: 40px;
  overflow: hidden;
}

/* ---------- NAVBAR ---------- */
.navbar {
  max-width: 1320px;
  margin: 0 auto;
  padding: 28px 56px 0;
  display: flex;
  align-items: center;
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}
.logo img {
  height: 44px;
  width: auto;
  display: block;
  border-radius: 12px;
}
.logo-text {
  font-size: 24px;
  font-weight: 600;
  color: #fff;
  letter-spacing: -.3px;
}

/* ---------- LEFT ---------- */
.left { align-self: center; max-width: 620px; }

.platforms {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 64px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 11px 22px;
  border: 1.5px solid #4a4a4a;
  border-radius: 999px;
  background: transparent;
  color: #fff;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color .2s, background .2s;
}
.pill:hover { border-color: #fff; background: rgba(255,255,255,.05); }
.pill svg { width: 19px; height: 19px; }

h1 {
  font-family: "Instrument Serif", Georgia, serif;
  font-weight: 400;
  font-size: clamp(48px, 6vw, 86px);
  line-height: 1.0;
  letter-spacing: -.3px;
  margin-bottom: 34px;
}

.subtext {
  color: #d4d4d4;
  font-size: 21px;
  line-height: 1.5;
  margin-bottom: 40px;
}

.cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--cream);
  color: #111;
  font-size: 19px;
  font-weight: 500;
  text-decoration: none;
  padding: 17px 34px;
  border-radius: 6px;
  transition: transform .15s, background .2s;
}
.cta:hover { background: #fff; transform: translateY(-1px); }
.cta .cta-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.stores {
  display: flex;
  gap: 14px;
  margin-bottom: 34px;
  flex-wrap: wrap;
}
.store-btn {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  padding: 10px 18px;
  border: 1.5px solid #3a3a3a;
  border-radius: 12px;
  background: #111;
  color: #fff;
  text-decoration: none;
  transition: border-color .2s;
}
.store-btn:hover { border-color: #666; }
.store-btn svg { width: 26px; height: 26px; }
.store-btn span { display: flex; flex-direction: column; line-height: 1.15; }
.store-btn small { font-size: 11px; color: #b5b5b5; }
.store-btn strong { font-size: 17px; font-weight: 600; }

/* ---------- RIGHT: IPHONE ---------- */
.right { display: flex; justify-content: center; align-items: center; z-index: 2; }

/* titanium frame */
.phone {
  position: relative;
  height: min(800px, calc(100vh - 140px));
  aspect-ratio: 380 / 800;
  width: auto;
  max-width: 100%;
  border-radius: 58px;
  padding: 12px;
  background: linear-gradient(150deg, #5b5b5e 0%, #2c2c2e 28%, #1d1d1f 55%, #3a3a3c 80%, #6b6b6e 100%);
  box-shadow:
    0 40px 90px rgba(0,0,0,.65),
    inset 0 0 0 2px rgba(255,255,255,.06);
}

/* side buttons */
.phone span[class^="btn-"] {
  position: absolute;
  background: linear-gradient(#3a3a3c, #1d1d1f);
  border-radius: 2px;
}
.btn-silent  { left: -2px; top: 132px; width: 3px; height: 28px; }
.btn-volup   { left: -2px; top: 180px; width: 3px; height: 52px; }
.btn-voldown { left: -2px; top: 246px; width: 3px; height: 52px; }
.btn-power   { right: -2px; top: 196px; width: 3px; height: 76px; }

/* the actual screen */
.screen {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 47px;
  background: #0a0a0a;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 0 18px;
}

/* status bar */
.statusbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 54px;
  padding: 0 8px;
  flex-shrink: 0;
}
.statusbar .time {
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  letter-spacing: .3px;
}
.status-icons {
  display: flex;
  align-items: center;
  gap: 6px;
}
.status-icons svg { height: 13px; width: auto; }

/* splash screen */
.splash {
  position: absolute;
  inset: 0;
  z-index: 7;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  background: #0a0a0a;
  border-radius: 47px;
  transition: opacity .6s ease;
}
.splash.hide {
  opacity: 0;
  pointer-events: none;
}
.splash img {
  width: 88px;
  height: 88px;
  border-radius: 22px;
  animation: splash-pop .7s cubic-bezier(.2,.8,.2,1) both;
}
.splash-name {
  color: #fff;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -.4px;
  animation: splash-fade .6s ease .25s both;
}
@keyframes splash-pop {
  0%   { transform: scale(.55); opacity: 0; }
  60%  { transform: scale(1.06); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes splash-fade {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* dynamic island */
.dynamic-island {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  width: 118px;
  height: 34px;
  background: #000;
  border-radius: 20px;
  z-index: 5;
}

/* home indicator */
.home-indicator {
  position: absolute;
  bottom: 9px;
  left: 50%;
  transform: translateX(-50%);
  width: 134px;
  height: 5px;
  border-radius: 3px;
  background: rgba(255,255,255,.85);
}

.phone-top {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  border-bottom: 1px solid #2a2a2a;
  padding-bottom: 18px;
  min-height: 0;
}

/* chat header — your profile icon, top-left */
.chat-header {
  display: flex;
  align-items: center;
  padding: 6px 2px 12px;
  flex-shrink: 0;
}
.profile-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  background: #2a2a2a;
  border: 1px solid #4a4a4a;
}

.contact {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin: 10px 0 22px;
}
.avatar {
  width: 56px; height: 56px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 38%, #d8b89a 0 30%, transparent 31%),
    linear-gradient(#3a3530, #25221e);
  background-size: cover;
  border: 1px solid #4a4a4a;
}
.contact-name { font-size: 15px; color: #e6e6e6; font-weight: 500; }

.messages {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  min-height: 0;
  justify-content: flex-end;
  overflow: hidden;
}
/* a message = avatar + bubble, so it's clear who it's from */
.msg-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  max-width: 88%;
  transition: opacity .3s ease, transform .3s cubic-bezier(.2,.8,.2,1);
}
.msg-row.recv { align-self: flex-start; }
.msg-row.sent { align-self: flex-end; flex-direction: row-reverse; }
/* entrance state: slide up + fade in */
.msg-row.enter {
  opacity: 0;
  transform: translateY(12px) scale(.96);
}

.avatar-sm {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border-radius: 50%;
  object-fit: cover;
  background: #2a2a2a;
  border: 1px solid #4a4a4a;
}

.bubble {
  padding: 12px 16px;
  border-radius: 20px;
  font-size: 15.5px;
  line-height: 1.35;
}

/* typing indicator */
.bubble.typing {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 15px 16px;
}
.bubble.typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #9a9a9a;
  animation: typing-bounce 1.2s infinite ease-in-out;
}
.bubble.typing span:nth-child(2) { animation-delay: .18s; }
.bubble.typing span:nth-child(3) { animation-delay: .36s; }
@keyframes typing-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: .4; }
  30%           { transform: translateY(-5px); opacity: 1; }
}
.bubble.sent {
  background: var(--bubble-sent);
  color: #1a1a1a;
  border-bottom-right-radius: 6px;
}
.bubble.recv {
  background: var(--bubble-recv);
  color: #fff;
  border-bottom-left-radius: 6px;
}
.msg-field {
  margin-top: 6px;
  padding: 13px 18px;
  border-radius: 22px;
  background: #1d1d1d;
  color: #777;
  font-size: 15px;
}

/* ---------- KEYBOARD / VOICE AREA ---------- */
.phone-bottom {
  position: relative;
  padding: 22px 6px 34px;
  min-height: 230px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}
.kb-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.round-btn {
  width: 48px; height: 48px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}
.round-btn.close { background: #2c2c2c; color: #bdbdbd; }
.round-btn.mic { background: var(--cream); }
.round-btn.mic svg { width: 24px; height: 24px; }

.waveform {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  /* gentle breathing, AI-assistant style */
  animation: siri-breathe 3.2s ease-in-out infinite;
}
.waveform span {
  width: 5px;
  border-radius: 3px;
  transform-origin: center;
  animation: pulse 1.1s ease-in-out infinite;
}
@keyframes siri-breathe {
  0%, 100% { transform: scale(1);    opacity: .9; }
  50%      { transform: scale(1.04); opacity: 1; }
}
/* white / gray mix, AI-assistant style */
.waveform span:nth-child(1)  { height: 14px; animation-delay: 0s;   background: #6e6e72; }
.waveform span:nth-child(2)  { height: 26px; animation-delay: .08s; background: #8a8a90; }
.waveform span:nth-child(3)  { height: 40px; animation-delay: .16s; background: #b8b8be; }
.waveform span:nth-child(4)  { height: 30px; animation-delay: .24s; background: #d4d4d8; }
.waveform span:nth-child(5)  { height: 52px; animation-delay: .32s; background: #eeeef0; }
.waveform span:nth-child(6)  { height: 38px; animation-delay: .40s; background: #fafafa; }
.waveform span:nth-child(7)  { height: 62px; animation-delay: .48s; background: #ffffff; }
.waveform span:nth-child(8)  { height: 40px; animation-delay: .40s; background: #fafafa; }
.waveform span:nth-child(9)  { height: 54px; animation-delay: .32s; background: #eeeef0; }
.waveform span:nth-child(10) { height: 30px; animation-delay: .24s; background: #d4d4d8; }
.waveform span:nth-child(11) { height: 42px; animation-delay: .16s; background: #b8b8be; }
.waveform span:nth-child(12) { height: 24px; animation-delay: .08s; background: #8a8a90; }
.waveform span:nth-child(13) { height: 14px; animation-delay: 0s;   background: #6e6e72; }
@keyframes pulse {
  0%   { transform: scaleY(.45); opacity: .7; }
  25%  { transform: scaleY(.9);  opacity: .95; }
  50%  { transform: scaleY(1.1); opacity: 1; }
  75%  { transform: scaleY(.7);  opacity: .9; }
  100% { transform: scaleY(.45); opacity: .7; }
}
/* slightly different speeds → fluid, non-uniform Siri wave */
.waveform span:nth-child(3n)   { animation-duration: 1.35s; }
.waveform span:nth-child(3n+1) { animation-duration: 1.05s; }
.waveform span:nth-child(4n)   { animation-duration: 1.55s; }


/* ---------- QR MODAL ---------- */
.qr-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.qr-modal[hidden] { display: none; }
.qr-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .6);
  backdrop-filter: blur(4px);
  animation: qr-fade .2s ease;
}
.qr-card {
  position: relative;
  background: #fff;
  color: #111;
  border-radius: 22px;
  padding: 34px 34px 26px;
  width: 340px;
  max-width: 100%;
  text-align: center;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .5);
  animation: qr-pop .25s cubic-bezier(.2,.8,.2,1);
}
.qr-close {
  position: absolute;
  top: 14px; right: 14px;
  width: 32px; height: 32px;
  border: none;
  border-radius: 50%;
  background: #f0f0f0;
  color: #555;
  font-size: 15px;
  cursor: pointer;
  transition: background .2s;
}
.qr-close:hover { background: #e3e3e3; }
.qr-card h3 {
  font-family: "Instrument Serif", Georgia, serif;
  font-size: 30px;
  font-weight: 400;
  margin-bottom: 8px;
}
.qr-card p {
  color: #666;
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 22px;
}
.qr-code {
  display: inline-flex;
  padding: 12px;
  background: #fff;
  border: 1px solid #ececec;
  border-radius: 14px;
}
.qr-code img, .qr-code canvas { display: block; border-radius: 4px; }
.qr-stores {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 20px;
}
.qr-stores a {
  color: #111;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}
.qr-stores a:hover { text-decoration: underline; }
.qr-divider {
  width: 1px;
  height: 14px;
  background: #ccc;
}
@keyframes qr-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes qr-pop {
  from { opacity: 0; transform: scale(.92) translateY(10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 940px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 60px;
    padding: 36px 28px 120px;
  }
  .platforms { margin-bottom: 40px; }

  /* center the phone mockup horizontally */
  .right { justify-content: center; }

  /* order: heading → subtext → Download Now → store buttons */
  .left { display: flex; flex-direction: column; align-items: flex-start; }
  h1       { order: 1; }
  .subtext { order: 2; }
  .cta     { order: 3; margin-bottom: 24px; }

  /* keep both store buttons on a single row */
  .stores { order: 4; margin-bottom: 0; flex-wrap: nowrap; width: 100%; }
  .store-btn { flex: 1 1 0; min-width: 0; justify-content: center; }

  .navbar { padding: 22px 28px 0; }

  /* smaller logo in the navbar on mobile */
  .logo img { height: 32px; border-radius: 9px; }
  .logo-text { font-size: 19px; }
  .logo { gap: 9px; }
}
@media (max-width: 600px) {
  /* let the title, subtext & buttons wrap naturally — drop the forced breaks */
  h1 br, .subtext br { display: none; }

  h1 {
    font-size: clamp(44px, 13vw, 62px);
    margin-bottom: 18px;
  }
  .subtext {
    font-size: 16px;
    line-height: 1.45;
    margin-bottom: 28px;
  }
  .cta {
    display: flex;
    width: 100%;
    justify-content: center;
    font-size: 17px;
    padding: 16px 28px;
  }
}

@media (max-width: 460px) {
  .hero { padding: 28px 20px 90px; gap: 44px; }
  .navbar { padding: 20px 20px 0; }

  .phone { border-radius: 50px; padding: 11px; }
  .screen { border-radius: 40px; }

  /* compact store buttons so both fit one row on narrow phones */
  .stores { gap: 10px; }
  .store-btn { gap: 7px; padding: 9px 10px; }
  .store-btn svg { width: 20px; height: 20px; }
  .store-btn small { font-size: 8.5px; }
  .store-btn strong { font-size: 13px; }
}

@media (max-width: 360px) {
  h1 { font-size: 40px; }
  .subtext { font-size: 15px; }
  .store-btn strong { font-size: 12px; }
  .store-btn small { font-size: 8px; }
}
