/* ============================================================
   Miratnama — toy shaqırıw beti
   Reńler hám shriftler
   ============================================================ */
@font-face {
  font-family: 'tstyle1';
  src: url('./texts/GeTravelscript.ttf');
  font-display: swap;
}
@font-face {
  font-family: 'tstyle2';
  src: url('./texts/Hello\ Beauty\ Personal\ Use.ttf');
  font-display: swap;
}
@font-face {
  font-family: 'tstyle3';
  src: url('./texts/News\ 705\ Italic\ BT.ttf');
  font-display: swap;
}

:root {
  --bg: #0d0a0a;
  --card: #1a1414;
  --ink: #f3e8e4;
  --muted: #b39a93;
  --accent: #d63b2e;
  --accent-deep: #a31f17;
  --line: #3a2826;
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.55);
  --accent-rgb: 214, 59, 46;
}

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

body {
  background: var(--bg);
  color: var(--ink);
  font-family: Georgia, 'Times New Roman', serif;
  display: flex;
  justify-content: center;
  padding: 24px 12px;
  line-height: 1.6;
}

/* Bas konteyner — qaǵaz korpus */
.korpus {
  width: 100%;
  max-width: 600px;
  background: var(--card);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

/* ---------- Hero súwret ---------- */
.fon {
  position: relative;
  width: 100%;
  height: 380px;
  overflow: hidden;
}
.fon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.fon::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(26, 20, 20, 0) 45%, var(--card) 100%);
  pointer-events: none;
}

/* ---------- Ulıwma bólim ---------- */
.card-section {
  text-align: center;
  padding: 30px 26px;
}
.card-section + .card-section {
  border-top: 1px solid var(--line);
}

.sec-title {
  font-family: 'tstyle3', Georgia, serif;
  font-size: 30px;
  font-weight: normal;
  color: var(--accent-deep);
  letter-spacing: 1px;
}

/* Bezew belgisi */
.orn {
  display: block;
  color: var(--accent);
  font-size: 22px;
  margin: 14px 0 18px;
}

/* ---------- Kirisiw bólimi ---------- */
.intro {
  margin-top: -40px;
  position: relative;
  z-index: 1;
}
.a1 {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--ink);
}
.tsyle {
  font-family: 'tstyle1', cursive;
  font-size: 38px;
  letter-spacing: 0;
  color: var(--accent);
  text-transform: none;
  display: inline-block;
}
.a2 {
  font-size: 18px;
  color: var(--muted);
  max-width: 460px;
  margin: 0 auto 26px;
}
.a4 {
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--muted);
  font-weight: normal;
}
.a5 {
  font-family: 'tstyle2', cursive;
  font-size: 52px;
  font-weight: normal;
  color: var(--accent-deep);
  margin-top: 6px;
  line-height: 1.1;
}

/* ---------- Mánzil ---------- */
.addr {
  font-size: 20px;
  font-weight: normal;
  color: var(--ink);
  margin-bottom: 22px;
}
.addr .rest {
  display: block;
  margin-top: 6px;
  font-weight: 700;
  color: var(--accent-deep);
}
.harita {
  display: flex;
  justify-content: center;
}
.harita iframe {
  width: 100%;
  max-width: 400px;
  height: 320px;
  border-radius: 14px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.5);
}

/* ---------- Baǵdarlama (timeline) ---------- */
.date {
  display: inline-block;
  font-size: 20px;
  letter-spacing: 2px;
  color: var(--accent);
  margin: 14px 0 28px;
  padding: 6px 18px;
  border: 1px solid var(--line);
  border-radius: 30px;
}
.qadaqlar {
  position: relative;
  max-width: 340px;
  margin: 0 auto;
  padding-left: 26px;
  text-align: left;
}
.qadaqlar::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--line);
}
.step {
  position: relative;
  padding: 0 0 26px 22px;
}
.step:last-child {
  padding-bottom: 0;
}
.step::before {
  content: "";
  position: absolute;
  left: -26px;
  top: 4px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--card), 0 0 0 5px var(--line);
}
.step .time {
  display: block;
  font-size: 22px;
  font-weight: 700;
  color: var(--accent-deep);
}
.step .label {
  display: block;
  font-size: 16px;
  color: var(--muted);
  margin-top: 2px;
}

/* ---------- Dizim (RSVP forma) ---------- */
.dizim {
  background: linear-gradient(180deg, #1a1414 0%, #221919 100%);
}
.inext {
  display: block;
  width: 100%;
  max-width: 380px;
  margin: 0 auto 16px;
  padding: 13px 16px;
  font-size: 16px;
  font-family: inherit;
  color: var(--ink);
  background: #2a1f1e;
  border: 1px solid var(--line);
  border-radius: 12px;
  transition: border-color .2s, box-shadow .2s;
}
.inext::placeholder { color: #8a726c; }
.inext:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.25);
}

.container {
  --s: 1.1em;
  --g: 12px;
  --c: var(--accent);
  display: inline-grid;
  grid-auto-rows: 1fr;
  gap: var(--g);
  position: relative;
  text-align: left;
  margin: 8px auto 4px;
}
label {
  display: inline-flex;
  line-height: var(--s);
  align-items: center;
  gap: 12px;
  cursor: pointer;
  font-size: 16px;
  color: var(--ink);
}
.abs {
  height: var(--s);
  aspect-ratio: 1;
  border: calc(var(--s)/8) solid var(--_c, #6b504c);
  border-radius: 50%;
  outline-offset: calc(var(--s)/10);
  padding: calc(var(--s)/8);
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  font-size: inherit;
  margin: 0;
  transition: .3s;
}
.abs:checked { --_c: var(--c); }
.container:before {
  content: "";
  position: absolute;
  height: calc(var(--s)/2);
  left: calc(var(--s)/4 + var(--_x, 0px));
  top: calc(var(--s)/4);
  background: var(--c);
  border-radius: 50%;
  aspect-ratio: 1;
  transition: .4s, left cubic-bezier(.1, -2000, .7, -2000) .4s;
}
.container:not(:has(.abs:checked)):before { --_i: -1; opacity: 0; }
.container:has(.abs:checked):before {
  opacity: 1;
  transform: translateY(calc(var(--_i)*(var(--s) + var(--g))));
}
.container:has(label:nth-child(1) .abs:checked):before { --_i: 0; --_x: .02px; }
.container:has(label:nth-child(2) .abs:checked):before { --_i: 1; --_x: .04px; }
.container:has(label:nth-child(3) .abs:checked):before { --_i: 2; --_x: .06px; }
.container:has(label:nth-child(4) .abs:checked):before { --_i: 3; --_x: .08px; }

.inext1 {
  display: none;
  width: 100%;
  max-width: 380px;
  margin: 18px auto 0;
  height: 130px;
  padding: 13px 16px;
  font-size: 16px;
  font-family: inherit;
  color: var(--ink);
  background: #2a1f1e;
  border: 1px solid var(--line);
  border-radius: 12px;
  resize: vertical;
}
.inext1::placeholder { color: #8a726c; }
.inext1:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.25);
}

/* ---------- JIBERIW tuymesi ---------- */
.glow-on-hover {
  width: 100%;
  max-width: 380px;
  height: 52px;
  margin: 22px auto 0;
  display: block;
  border: none;
  outline: none;
  color: #fff;
  background: var(--accent-deep);
  cursor: pointer;
  position: relative;
  z-index: 0;
  border-radius: 12px;
  font-family: inherit;
  font-size: 16px;
  letter-spacing: 2px;
  transition: background .25s, transform .15s;
}
.glow-on-hover:hover { background: var(--accent); }
.glow-on-hover:active { transform: translateY(1px); }
.glow-on-hover:disabled { opacity: .6; cursor: not-allowed; }

/* ---------- Taymer ---------- */
.timer {
  display: flex;
  justify-content: center;
  padding: 34px 20px;
  background: #000;
}
.timer__items {
  display: flex;
  gap: 14px;
}
.timer__item {
  position: relative;
  min-width: 64px;
  background: linear-gradient(160deg, #2a1212 0%, #1a0c0c 100%);
  color: #fff;
  padding: 16px 10px 26px;
  border-radius: 12px;
  font-size: 26px;
  font-weight: 700;
  text-align: center;
  border: 1px solid #4a1a16;
  box-shadow: inset 0 0 14px rgba(0, 0, 0, 0.5);
}
.timer__item::after {
  content: attr(data-title);
  position: absolute;
  left: 0;
  bottom: 8px;
  width: 100%;
  text-align: center;
  font-size: 11px;
  font-weight: normal;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6);
}

/* ---------- Tilek silteme ---------- */
.tilek-link {
  display: flex;
  justify-content: center;
  padding: 28px 0 34px;
  background: var(--card);
}
.tilek-link a {
  text-decoration: none;
  color: #fff;
  background: var(--accent);
  padding: 13px 28px;
  border-radius: 30px;
  font-size: 16px;
  box-shadow: 0 6px 16px rgba(var(--accent-rgb), 0.4);
  transition: transform .2s, background .2s;
}
.tilek-link a:hover {
  background: var(--accent-deep);
  transform: translateY(-3px);
}

/* Qalqıp ushatuǵın júrekler CSS-i hearts.js ishine kóshirildi (hár betde isleydi) */

/* ---------- Bólimlerdiń skroll arqalı kórinisi ---------- */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity .8s ease-out, transform .8s ease-out;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Timeline qádemlerin birinen soń biri shıǵaramız */
.step {
  opacity: 0;
  transform: translateX(-20px);
  transition: opacity .6s ease-out, transform .6s ease-out;
}
.step.visible {
  opacity: 1;
  transform: translateX(0);
}

/* Atlardı názik «tınıs alıw» */
.a5 {
  animation: softPulse 3.5s ease-in-out infinite;
}
@keyframes softPulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.04); }
}

/* ---------- Animaciya (eski klass — keri uyleslik) ---------- */
.animate-section {
  opacity: 1;
  transform: translateY(0);
  transition: opacity .6s ease-out, transform .6s ease-out;
}

/* Háreketti kemeytiwdi qálegenler ushın */
@media (prefers-reduced-motion: reduce) {
  .hearts-layer { display: none; }
  .reveal, .step, .a5 { animation: none !important; transition: none !important; opacity: 1 !important; transform: none !important; }
}

/* ============================================================
   Kirisiw konverti
   ============================================================ */
#envelope-cover {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 38%, #2a1414 0%, #140c0c 55%, #000 100%);
  cursor: pointer;
  transition: opacity 1.5s ease, transform 1.7s ease, visibility 1.7s;
}
#envelope-cover.zoom {
  opacity: 0;
  transform: scale(1.8);
  visibility: hidden;
  pointer-events: none;
}

.env-wrap {
  text-align: center;
  animation: envFloat 3s ease-in-out infinite;
}

.env-top {
  font-size: 18px;
  letter-spacing: 2px;
  color: var(--muted);
  margin-bottom: 26px;
  text-transform: uppercase;
}

/* Konverttiń ózi */
.envelope {
  position: relative;
  width: 300px;
  height: 200px;
  margin: 0 auto;
  perspective: 900px;
  filter: drop-shadow(0 18px 34px rgba(0, 0, 0, 0.6)) drop-shadow(0 0 18px rgba(214, 59, 46, 0.25));
}

.env-back {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #2a1413 0%, #1a0d0c 100%);
  border-radius: 10px;
  z-index: 1;
}

/* Ishki xat — ashılǵanda joqarıǵa shıǵadı */
.env-letter {
  position: absolute;
  left: 14px;
  right: 14px;
  top: 16px;
  height: 158px;
  background: #fbf4ee;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  opacity: 0;
  transition: transform 1.3s cubic-bezier(.2,.8,.3,1) .85s, opacity .7s .85s;
}
.env-letter-sub {
  font-size: 12px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: #9a6a64;
}
.env-letter-place {
  font-family: 'tstyle3', Georgia, serif;
  font-size: 25px;
  color: var(--accent-deep);
  line-height: 1.15;
  margin-top: 2px;
}
.env-letter-addr {
  font-size: 14px;
  color: #7a5550;
}
.env-letter-when {
  margin-top: 8px;
  font-size: 15px;
  letter-spacing: .5px;
  color: var(--accent);
  font-weight: 700;
}

/* Aldıńǵı qaltası (úshmúyish) */
.env-pocket {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #4a1714 0%, #2c0e0c 100%);
  clip-path: polygon(0 100%, 100% 100%, 50% 30%);
  border-radius: 0 0 10px 10px;
  z-index: 4;
}

/* Aldıdaǵı atlar (jabıq turǵanda kórinedi) */
.env-title {
  position: absolute;
  bottom: 28px;
  left: 0;
  right: 0;
  text-align: center;
  font-family: 'tstyle2', cursive;
  font-size: 32px;
  color: #f3e8e4;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
  z-index: 5;
  transition: opacity .5s;
}

/* Joqarǵı qaqpaǵı — ashılǵanda aylanıp ashıladı */
.env-flap {
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  border-left: 150px solid transparent;
  border-right: 150px solid transparent;
  border-top: 108px solid #3a1411;
  transform-origin: top center;
  transition: transform 1.4s ease, border-top-color 1.4s;
  z-index: 6;
}

/* Júrek múri */
.env-heart {
  position: absolute;
  top: 78px;
  left: 50%;
  transform: translateX(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #e0463a, #b01a12);
  color: #fff;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.5), inset 0 0 6px rgba(0,0,0,0.3);
  z-index: 7;
  transition: opacity .5s, transform .5s;
}

.env-hint {
  margin-top: 30px;
  font-size: 16px;
  color: var(--accent);
  animation: hintPulse 1.6s ease-in-out infinite;
}

/* ----- Ashılǵan halı ----- */
.envelope.open .env-flap {
  transform: rotateX(180deg);
  border-top-color: #2c0e0c;
  z-index: 1;
}
.envelope.open .env-heart {
  opacity: 0;
  transform: translateX(-50%) scale(0);
}
.envelope.open .env-title {
  opacity: 0;
}
.envelope.open .env-letter {
  opacity: 1;
  transform: translateY(-96px);
  z-index: 8;
}

@keyframes envFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-10px); }
}
@keyframes hintPulse {
  0%, 100% { opacity: .5; transform: translateY(0); }
  50%      { opacity: 1; transform: translateY(3px); }
}

/* ---------- Responsiv ---------- */
@media (max-width: 420px) {
  body { padding: 0; }
  .korpus { border-radius: 0; }
  .a5 { font-size: 42px; }
  .a1 { font-size: 25px; }
  .timer__item { min-width: 56px; font-size: 22px; }
}
