/* ═══════════════════════════════════════════════
   kudos — phone.css
   iPhone component: chassis, screen, messages, animations
═══════════════════════════════════════════════ */

/* ── Wrapper ── */
.iphone-wrap {
  display: flex;
  justify-content: center;
  padding: 0 0 16px;
}

/* ── Spring entrance ── */
.iphone-entrance {
  opacity: 0;
  -webkit-transform: translateY(72px) scale(0.97);
  transform: translateY(72px) scale(0.97);
  -webkit-transition: opacity 1.0s cubic-bezier(0.22,1,0.36,1),
                      -webkit-transform 1.0s cubic-bezier(0.22,1,0.36,1);
  transition: opacity 1.0s cubic-bezier(0.22,1,0.36,1),
              transform 1.0s cubic-bezier(0.22,1,0.36,1);
}
.iphone-entrance.visible {
  opacity: 1;
  -webkit-transform: translateY(0) scale(1);
  transform: translateY(0) scale(1);
}

/* ── Chassis ── */
.iphone-chassis {
  position: relative;
  width: 286px;
  height: 618px;
  border-radius: 44px;
  background: linear-gradient(145deg,
    #6a6a6a 0%,
    #4a4a4a 15%,
    #2e2e2e 35%,
    #383838 55%,
    #4e4e4e 75%,
    #5e5e5e 90%,
    #707070 100%);
  box-shadow:
    0 40px 80px -12px rgba(0,0,0,0.50),
    0 16px 32px -8px rgba(0,0,0,0.30),
    0 0 0 1px rgba(0,0,0,0.60),
    inset 1px 1px 0 rgba(255,255,255,0.18),
    inset -1px -1px 0 rgba(0,0,0,0.30);
  isolation: isolate;
}

.iphone-chassis::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 44px;
  background: linear-gradient(125deg,
    rgba(255,255,255,0.35) 0%,
    rgba(255,255,255,0.12) 25%,
    rgba(255,255,255,0.00) 50%,
    rgba(0,0,0,0.10) 75%,
    rgba(255,255,255,0.08) 100%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box,
                linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  padding: 1.5px;
  pointer-events: none;
  z-index: 20;
}

/* ── Side buttons ── */
.btn-vol-up, .btn-vol-down, .btn-silent, .btn-power {
  position: absolute;
  border-radius: 1.5px;
  z-index: 5;
  background: linear-gradient(90deg, #555 0%, #333 50%, #444 100%);
  box-shadow: 0 0 0 0.5px rgba(0,0,0,0.4);
}
.btn-silent  { left:-2px; top:134px; width:2.5px; height:32px; border-radius:2px 0 0 2px; }
.btn-vol-up  { left:-2px; top:184px; width:2.5px; height:54px; border-radius:2px 0 0 2px; }
.btn-vol-down{ left:-2px; top:250px; width:2.5px; height:54px; border-radius:2px 0 0 2px; }
.btn-power   { right:-2px; top:200px; width:2.5px; height:80px; border-radius:0 2px 2px 0; }

/* ── Screen glass ── */
.iphone-screen-outer {
  position: absolute;
  top: 6px; left: 6px; right: 6px; bottom: 6px;
  border-radius: 39px;
  overflow: hidden;
  background: #fff;
  box-shadow:
    0 0 0 2.5px #111111,
    0 0 0 4px #2a2a2a,
    inset 0 0 0 0.5px rgba(0,0,0,0.09),
    inset 0 1px 0 rgba(255,255,255,0.5);
}

/* ── Dynamic Island ── */
.dynamic-island {
  position: absolute;
  top: 12px;
  left: 50%;
  -webkit-transform: translateX(-50%);
  transform: translateX(-50%);
  width: 35%;
  height: 26px;
  background: #000;
  border-radius: 20px;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 7px;
}

.dynamic-island::after {
  content: '';
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 32%,
    #1e3d52 0%,
    #0f2233 30%,
    #060e18 60%,
    #020609 100%);
  box-shadow:
    0 0 0 1px #0d0d0d,
    0 0 0 2px #1a1a1a,
    inset 1px 1px 2px rgba(255,255,255,0.12),
    0 0 4px rgba(0,0,0,0.8);
}

/* ── Screen inner layout ── */
.iphone-inner {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  overflow: hidden; background: #fff;
}

/* ── Status bar ── */
.ios-statusbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 10px 0 18px;
  height: 52px;
  flex-shrink: 0;
}
.sb-time {
  font-family: -apple-system, 'SF Pro Display', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: #000;
  letter-spacing: -0.3px;
  margin-left: 6px;
}
.sb-icons {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-right: -2px;
}
.sb-icons img { height: 13px; display: block; }
.sb-icons img:nth-child(2) { height: 15px; width: 19px; }

/* ── Contact header ── */
.ios-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  padding: 2px 16px 6px 28px;
  background: #fff;
  border-bottom: 0.5px solid rgba(0,0,0,0.10);
  flex-shrink: 0;
}

.ios-back {
  position: absolute;
  left: 12px;
  top: 44%;
  -webkit-transform: translateY(-50%);
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  background: #f2f2f7;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ios-back-chevron {
  font-family: -apple-system, sans-serif;
  font-size: 20px;
  font-weight: 300;
  color: #000;
  line-height: 1;
  margin-left: -2px;
  margin-top: -3px;
}

.ios-av {
  width: 44px;
  height: 44px;
  background: #34c759;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  font-family: -apple-system, sans-serif;
  margin-bottom: 3px;
  box-shadow: inset 0 -2px 6px rgba(0,0,0,0.12), inset 0 1px 2px rgba(255,255,255,0.25);
}

.ios-name {
  display: flex;
  align-items: center;
  gap: 2px;
  background: #f2f2f7;
  border-radius: 10px;
  padding: 2px 7px 2px 10px;
}
.ios-name-text {
  font-family: -apple-system, 'SF Pro Text', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: #000;
  letter-spacing: -0.2px;
}
.ios-name-chevron {
  font-family: -apple-system, sans-serif;
  font-size: 11px;
  color: #8e8e93;
  font-weight: 500;
}

/* ── Message thread ── */
.ios-msgs {
  flex: 1;
  padding: 5px 12px 2px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: #fff;
  overflow: hidden;
}
.ios-time {
  text-align: center;
  font-size: 10px;
  color: #8e8e93;
  font-weight: 400;
  margin: 0 0 3px;
  font-family: -apple-system, sans-serif;
}

.ios-row { display: flex; align-items: flex-end; }
.ios-row.s { justify-content: flex-end; }
.ios-row.r { justify-content: flex-start; }

/* ── Bubbles ── */
.ios-bbl {
  max-width: 80%;
  padding: 7px 11px;
  border-radius: 18px;
  font-size: 13px;
  line-height: 1.3;
  font-family: -apple-system, 'SF Pro Text', sans-serif;
  letter-spacing: -0.1px;
  text-align: left;
}
.ios-bbl.sent {
  background: #34c759;
  color: #fff;
  border-bottom-right-radius: 4px;
  text-align: left;
}
.ios-bbl.recv {
  background: #e9e9eb;
  color: #000;
  border-bottom-left-radius: 4px;
  overflow-wrap: break-word;
  text-align: left;
}

.ios-delivered {
  text-align: right;
  font-size: 10px;
  color: #8e8e93;
  font-family: -apple-system, sans-serif;
  margin-top: 1px;
  padding-right: 2px;
}

/* ── Input bar ── */
.ios-input-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px 24px;
  background: #fff;
  border-top: 0.5px solid rgba(0,0,0,0.10);
  flex-shrink: 0;
}
.ios-plus {
  font-family: -apple-system, sans-serif;
  font-size: 26px;
  font-weight: 300;
  color: #3c3c43;
  line-height: 1;
  flex-shrink: 0;
  width: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ios-field-wrap { flex: 1; position: relative; display: flex; align-items: center; }
.ios-field {
  width: 100%;
  height: 34px;
  background: #fff;
  border-radius: 17px;
  border: 1px solid #d1d1d6;
  padding: 0 36px 0 14px;
  font-size: 14px;
  font-family: -apple-system, sans-serif;
  color: #8e8e93;
  display: flex;
  align-items: center;
  box-sizing: border-box;
}
.ios-mic {
  position: absolute;
  right: 10px;
  top: 50%;
  -webkit-transform: translateY(-50%);
  transform: translateY(-50%);
  display: flex;
  align-items: center;
}

/* ── Menu photo bubble ── */
.ios-img-bubble { padding: 0 !important; border-radius: 18px !important; overflow: hidden; }
.img-preview {
  width: 170px;
  height: 124px;
  border-radius: 14px;
  overflow: hidden;
}
.img-preview img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.img-inner {
  width: 100%; height: 100%;
  background: linear-gradient(165deg, #7a5a10 0%, #9a7018 30%, #b88820 55%, #7a5a10 100%);
  position: relative; overflow: hidden;
}
.img-inner::before {
  content: ''; position: absolute;
  top: 8px; left: 22px; right: 22px; bottom: 8px;
  background: #f8f7f3; border-radius: 2px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.35);
}
.img-inner::after {
  content: ''; position: absolute;
  top: 22px; left: 34px; right: 34px; bottom: 22px;
  background: repeating-linear-gradient(to bottom, #bbb 0px, #bbb 1px, transparent 1px, transparent 8px);
}
.menu-title {
  position: absolute; top: 16px; left: 50%;
  -webkit-transform: translateX(-50%);
  transform: translateX(-50%);
  font-size: 6.5px; font-family: Georgia, serif; color: #222;
  font-weight: 700; letter-spacing: 2px; white-space: nowrap; z-index: 2; text-transform: uppercase;
}

/* ── Bubble spring animations ── */
.msg-anim {
  opacity: 0;
  -webkit-transform: translateY(10px) scale(0.95);
  transform: translateY(10px) scale(0.95);
  -webkit-transition: opacity 0.38s cubic-bezier(0.34,1.56,0.64,1),
                      -webkit-transform 0.38s cubic-bezier(0.34,1.56,0.64,1);
  transition: opacity 0.38s cubic-bezier(0.34,1.56,0.64,1),
              transform 0.38s cubic-bezier(0.34,1.56,0.64,1);
  will-change: opacity, transform;
}
.msg-anim.show {
  opacity: 1;
  -webkit-transform: translateY(0) scale(1);
  transform: translateY(0) scale(1);
}

/* ── Typing indicator ── */
.typing-indicator { display:flex; align-items:center; gap:4px; padding:9px 12px !important; }
.typing-indicator .dot {
  width:6px; height:6px; background:#8e8e93; border-radius:50%;
  -webkit-animation: typingBounce 1.2s infinite ease-in-out;
  animation: typingBounce 1.2s infinite ease-in-out;
}
.typing-indicator .dot:nth-child(2) { -webkit-animation-delay:0.16s; animation-delay:0.16s; }
.typing-indicator .dot:nth-child(3) { -webkit-animation-delay:0.32s; animation-delay:0.32s; }
@-webkit-keyframes typingBounce {
  0%,55%,100% { -webkit-transform:translateY(0); opacity:0.4; }
  27% { -webkit-transform:translateY(-6px); opacity:1; }
}
@keyframes typingBounce {
  0%,55%,100% { transform:translateY(0); opacity:0.4; }
  27% { transform:translateY(-6px); opacity:1; }
}

/* ── Responsive ── */
@media (max-width: 480px) {
  /* Chassis */
  .iphone-chassis { width: 248px; height: 536px; border-radius: 38px; }
  .iphone-chassis::before { border-radius: 38px; }
  .iphone-screen-outer { border-radius: 33px; top: 5px; left: 5px; right: 5px; bottom: 5px; }

  /* Dynamic Island */
  .dynamic-island { width: 32%; height: 22px; top: 10px; }

  /* Entrance animation — webkit for mobile Safari */
  .iphone-entrance {
    opacity: 0;
    -webkit-transform: translateY(40px) scale(0.97);
    transform: translateY(40px) scale(0.97);
    -webkit-transition: opacity 0.9s cubic-bezier(0.22,1,0.36,1),
                        -webkit-transform 0.9s cubic-bezier(0.22,1,0.36,1);
    transition: opacity 0.9s cubic-bezier(0.22,1,0.36,1),
                transform 0.9s cubic-bezier(0.22,1,0.36,1);
  }
  .iphone-entrance.visible {
    opacity: 1;
    -webkit-transform: translateY(0) scale(1);
    transform: translateY(0) scale(1);
  }

  /* Status bar */
  .ios-statusbar { padding: 10px 8px 0 14px; height: 42px; }
  .sb-time { font-size: 12px; margin-left: 2px; }
  .sb-icons { gap: 3px; margin-right: 0; }
  .sb-icons img { height: 10px; }
  .sb-icons img:nth-child(2) { height: 11px; width: 14px; }

  /* Contact header */
  .ios-header { padding: 2px 12px 5px 22px; }
  .ios-av { width: 36px; height: 36px; font-size: 16px; }
  .ios-back { width: 24px; height: 24px; left: 8px; }
  .ios-back-chevron { font-size: 16px; }
  .ios-name-text { font-size: 11px; }
  .ios-name-chevron { font-size: 9px; }

  /* Messages */
  .ios-msgs { padding: 4px 10px 2px; gap: 2px; }
  .ios-bbl { font-size: 11px; padding: 5px 9px; border-radius: 14px; }
  .ios-time { font-size: 9px; }
  .ios-delivered { font-size: 9px; }

  /* Menu photo */
  .img-preview { width: 148px; height: 108px; }

  /* Input bar */
  .ios-input-bar { padding: 6px 10px 18px; gap: 6px; }
  .ios-field { height: 28px; font-size: 12px; }
  .ios-plus { font-size: 20px; width: 20px; }

  /* Typing dots */
  .typing-indicator .dot { width: 5px; height: 5px; }
  .typing-indicator { padding: 7px 10px !important; gap: 3px; }

  /* Page layout */
  .hero { padding: 64px 0 0; }
  .waitlist { margin-top: 40px; }
}
