/* =====================================================================
   JOUINK — kağıt üzerine mürekkep
   ===================================================================== */

:root {
  --paper: #F3EFE7;
  --paper-2: #EBE6DB;          /* kart / input zemini */
  --ink: #141414;
  --muted: #6E685F;
  --line: rgba(20, 20, 20, 0.14);
  --line-strong: rgba(20, 20, 20, 0.38);
  --accent: #A3341F;           /* yalnızca hata mesajları */

  --serif: "Fraunces", "Iowan Old Style", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --radius: 3px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --gutter: 20px;
  --kb: 0px;                   /* mobil klavye yüksekliği (app.js ayarlar) */
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background-color: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

/* Çok hafif kağıt dokusu */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.35;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.08 0 0 0 0 0.07 0 0 0 0 0.05 0 0 0 .09 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

img { display: block; max-width: 100%; height: auto; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
p { margin: 0; }
h1, h2, h3 { margin: 0; font-weight: 600; }

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

.wrap {
  width: 100%;
  max-width: 1080px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.num, .tnum {
  font-variant-numeric: tabular-nums lining-nums;
  font-feature-settings: "tnum" 1, "lnum" 1;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  padding: 10px 14px;
  background: var(--ink);
  color: var(--paper);
  z-index: 100;
}
.skip-link:focus { top: 12px; }

.text-link {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: var(--line-strong);
}
.text-link:hover { text-decoration-color: var(--ink); }

/* ---------------------------------------------------------------------
   Header
   --------------------------------------------------------------------- */

.site-header {
  padding-top: 44px;
  padding-bottom: 28px;
  text-align: center;
}

.eyebrow {
  margin-bottom: 14px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.32em;
  text-indent: 0.32em;
  text-transform: uppercase;
}

.rule {
  display: block;
  width: 40px;
  height: 1px;
  margin: 22px auto 0;
  background: var(--ink);
}

.brand {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(56px, 19vw, 120px);
  line-height: 0.9;
  letter-spacing: 0.01em;
  font-variation-settings: "opsz" 144, "SOFT" 0, "WONK" 0;
}
.brand img {
  display: inline-block;
  width: auto;
  height: clamp(56px, 19vw, 120px);
}

.event-line {
  margin-top: 18px;
  font-variant-numeric: tabular-nums;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.02em;
}
.event-line .sep { color: var(--muted); padding-inline: 0.35em; }

.venue-line {
  margin-top: 4px;
  font-size: 15px;
  font-weight: 500;
}
.venue-line .text-link { margin-left: 0.6em; white-space: nowrap; font-weight: 400; color: var(--muted); }

/* ---------------------------------------------------------------------
   Giriş satırı + bant
   --------------------------------------------------------------------- */

.intro {
  padding: 4px 0 0;
  text-align: center;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  color: var(--muted);
  text-wrap: balance;
}

.banner {
  margin-top: 20px;
  padding: 16px 18px;
  border: 1px solid var(--ink);
  text-align: center;
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.35;
}

/* ---------------------------------------------------------------------
   Bölüm başlıkları
   --------------------------------------------------------------------- */

.section-title {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 14px;
}


/* ---------------------------------------------------------------------
   Katalog
   --------------------------------------------------------------------- */

.catalog { margin-top: 40px; outline: none; }

.catalog-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 14px;
}
.catalog-head .section-title { margin: 0; }
.catalog-hint {
  font-size: 13px;
  color: var(--muted);
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.card {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  padding: 0;
  border: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  text-align: left;
  overflow: hidden;
  transition: background-color 180ms var(--ease);
  touch-action: manipulation;
}
.card:focus-visible { outline-offset: -3px; }
@media (hover: hover) {
  .card:not([aria-disabled="true"]):hover { background: rgba(20, 20, 20, 0.025); }
}
.card:not([aria-disabled="true"]):active { background: rgba(20, 20, 20, 0.05); }
.card:not([aria-disabled="true"]):active .card-media { transform: scale(0.95); }

/* Sayfa açılışında kartlar sırayla, sakin belirir */
.card.is-entering {
  animation: card-in 520ms var(--ease) both;
  animation-delay: calc(min(var(--i), 12) * 35ms);
}
@keyframes card-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

.card-media {
  position: absolute;
  inset: 13% 15% 21% 15%;
  display: grid;
  place-items: center;
  transition: transform 180ms var(--ease);
}
.card-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.card-num {
  position: absolute;
  left: 12px;
  bottom: 9px;
  font-family: var(--serif);
  font-size: 15px;
  letter-spacing: 0.01em;
  font-variant-numeric: tabular-nums lining-nums;
}

/* Alınmış / seçilemez */
.card[aria-disabled="true"] { cursor: default; }
.card.is-taken .card-media,
.card.is-taken .card-num {
  opacity: 0.28;
  filter: grayscale(1);
}
.card.is-locked:not(.is-taken) .card-media { opacity: 0.75; }

/* Mürekkep damgası */
.stamp {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-11deg);
  padding: 5px 12px 4px;
  border: 1.5px solid var(--ink);
  outline: 1px solid var(--ink);
  outline-offset: 2px;
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-indent: 0.24em;
  color: var(--ink);
  opacity: 0.86;
  mix-blend-mode: multiply;
  /* düzensiz mürekkep izi */
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='60'%3E%3Cfilter id='s'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -1.5 1.8'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23s)'/%3E%3C/svg%3E");
          mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='60'%3E%3Cfilter id='s'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -1.5 1.8'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23s)'/%3E%3C/svg%3E");
  pointer-events: none;
  white-space: nowrap;
}

/* İskelet */
.card.is-skeleton {
  background: linear-gradient(100deg, var(--paper-2) 30%, #F7F4EE 50%, var(--paper-2) 70%);
  background-size: 300% 100%;
  animation: shimmer 1.4s linear infinite;
}
@keyframes shimmer {
  from { background-position: 100% 0; }
  to   { background-position: 0 0; }
}

.load-error {
  padding: 40px 0;
  text-align: center;
  display: grid;
  gap: 16px;
  justify-items: center;
  color: var(--muted);
}

/* ---------------------------------------------------------------------
   Footer
   --------------------------------------------------------------------- */

.site-footer {
  margin-top: 64px;
  padding-top: 32px;
  padding-bottom: calc(32px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  text-align: center;
  font-size: 14px;
}
.footer-mark {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.site-footer .text-link { display: inline-flex; align-items: center; min-height: 44px; }
.site-footer small { color: var(--muted); font-size: 12px; }

/* ---------------------------------------------------------------------
   Butonlar
   --------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 20px;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: background-color 160ms var(--ease), color 160ms var(--ease), opacity 160ms var(--ease), transform 120ms var(--ease);
  touch-action: manipulation;
}
.btn:active:not(:disabled) { transform: scale(0.98); }
.btn-primary {
  background: var(--ink);
  color: var(--paper);
  font-variant-numeric: tabular-nums;
}
.btn-primary:disabled {
  background: transparent;
  color: var(--muted);
  border-color: var(--line-strong);
  cursor: not-allowed;
}
.btn-primary[aria-busy="true"] { cursor: progress; }
.btn-outline { background: transparent; color: var(--ink); }
.btn-outline:hover { background: rgba(20, 20, 20, 0.05); }
.btn-small { min-height: 44px; padding: 0 14px; font-size: 14px; }
.btn-block { width: 100%; }

.spinner {
  width: 16px;
  height: 16px;
  border: 1.5px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------------
   Toast
   --------------------------------------------------------------------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(20px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 60;
  width: max-content;
  max-width: calc(100vw - 32px);
  padding: 13px 18px;
  background: var(--ink);
  color: var(--paper);
  border-radius: var(--radius);
  font-size: 14px;
  text-align: center;
  animation: toast-in 220ms var(--ease);
}
@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, 8px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

/* ---------------------------------------------------------------------
   Sheet
   --------------------------------------------------------------------- */

.sheet-root {
  position: fixed;
  inset: 0;
  z-index: 50;
}
.sheet-root[hidden] { display: none; }

.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 20, 20, 0.42);
  opacity: 0;
  transition: opacity 260ms var(--ease);
}

.sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: var(--kb);
  height: min(90vh, calc(100vh - var(--kb) - 12px));
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border-radius: 14px 14px 0 0;
  box-shadow: 0 -1px 0 var(--line), 0 -12px 40px rgba(20, 20, 20, 0.12);
  transform: translateY(100%);
  transition: transform 320ms var(--ease);
  overflow: hidden;
  outline: none;
}
@supports (height: 1dvh) {
  .sheet { height: min(90dvh, calc(100dvh - var(--kb) - 12px)); }
}

.sheet-root.is-open .sheet-backdrop { opacity: 1; }
.sheet-root.is-open .sheet { transform: translateY(0); }
.sheet.is-dragging { transition: none; }

.sheet-grab {
  position: relative;
  flex: none;
  height: 44px;
  touch-action: none;
  cursor: grab;
}
.sheet-handle {
  position: absolute;
  top: 9px;
  left: 50%;
  width: 40px;
  height: 4px;
  margin-left: -20px;
  border-radius: 2px;
  background: var(--line-strong);
}
.sheet-close {
  position: absolute;
  top: 2px;
  right: 6px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  border-radius: 50%;
}
.sheet-close:hover { background: rgba(20, 20, 20, 0.06); }
.sheet-close:focus-visible { outline-offset: -4px; }

.sheet-view {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  margin: 0;
}
.sheet-view[hidden] { display: none; }

.sheet-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 0 var(--gutter) 24px;
}

.sheet-footer {
  flex: none;
  padding: 12px var(--gutter) calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: var(--paper);
}

/* Önizleme */
.preview {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding-bottom: 6px;
}
.preview-media {
  width: min(48vw, 190px);
  aspect-ratio: 1 / 1;
  padding: 12%;
  border: 1px solid var(--line);
}
.preview-media img { width: 100%; height: 100%; object-fit: contain; }
.preview-title {
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 400;
  line-height: 1.1;
  font-variant-numeric: tabular-nums lining-nums;
}

.block {
  margin: 22px 0 0;
  padding: 0;
  border: 0;
  min-width: 0;
}
.block-title {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  width: 100%;
  padding: 0;
  margin-bottom: 12px;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.block-hint {
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--muted);
}

/* Saat chip'leri */
.chips {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.chip { position: relative; display: block; }
.chip input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}
.chip span {
  display: grid;
  place-items: center;
  height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: background-color 140ms var(--ease), color 140ms var(--ease), border-color 140ms var(--ease);
  user-select: none;
}
.chip:hover span { border-color: var(--ink); }
.chip input:checked + span {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}
.chip input:focus-visible + span {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}
.chip.is-skeleton span {
  border-color: transparent;
  background: var(--paper-2);
  cursor: default;
}
.chips-empty {
  grid-column: 1 / -1;
  padding: 14px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}
.chips-empty .btn { margin-top: 10px; }

/* Form alanları */
.field { margin-top: 14px; }
.field:first-of-type { margin-top: 0; }
.field label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 500;
}
.optional { color: var(--muted); font-weight: 400; }
.field input[type="text"],
.field input[type="tel"] {
  display: block;
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.35);
  font-size: 16px;            /* iOS zoom'u engeller */
  transition: border-color 140ms var(--ease), background-color 140ms var(--ease);
  scroll-margin: 90px 0 120px;
}
.field input::placeholder { color: #A39D93; }
.field input:focus {
  outline: none;
  border-color: var(--ink);
  background: rgba(255, 255, 255, 0.6);
  box-shadow: 0 0 0 1px var(--ink);
}
.field input[aria-invalid="true"] { border-color: var(--accent); }

.field-check {
  display: grid;
  grid-template-columns: 24px 1fr;
  column-gap: 12px;
  align-items: center;
  margin-top: 18px;
}
.field-check input {
  appearance: none;
  -webkit-appearance: none;
  width: 24px;
  height: 24px;
  margin: 0;
  border: 1px solid var(--ink);
  border-radius: 2px;
  background: transparent;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.field-check input::after {
  content: "";
  width: 11px;
  height: 6px;
  border-left: 2px solid var(--paper);
  border-bottom: 2px solid var(--paper);
  transform: translateY(-1px) rotate(-45deg);
  opacity: 0;
}
.field-check input:checked { background: var(--ink); }
.field-check input:checked::after { opacity: 1; }
.field-check input[aria-invalid="true"] { border-color: var(--accent); }
.field-check label {
  margin: 0;
  min-height: 44px;
  display: flex;
  align-items: center;
  font-size: 15px;
  cursor: pointer;
}
.field-check .field-error { grid-column: 1 / -1; }

.field-error {
  margin-top: 6px;
  font-size: 13px;
  color: var(--accent);
}

.privacy-note {
  margin-top: 14px;
  font-size: 13px;
  color: var(--muted);
}

/* Honeypot: görünmez ama DOM'da */
.hp {
  position: absolute !important;
  left: -9999px !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Form uyarısı (sticky footer üstünde) */
.form-alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  padding: 10px 12px;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  color: var(--accent);
  font-size: 14px;
  line-height: 1.4;
}
.form-alert[hidden] { display: none; }
.form-alert .btn { flex: none; border-color: var(--accent); color: var(--accent); }

/* Başarı ekranı */
.success {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 14px;
  padding-top: 4px;
}
.success-eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.success-code {
  font-family: var(--serif);
  font-size: clamp(56px, 18vw, 76px);
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums lining-nums;
  outline: none;
}
.success-media {
  width: min(44vw, 170px);
  aspect-ratio: 1 / 1;
  padding: 12%;
  border: 1px solid var(--line);
}
.success-media img { width: 100%; height: 100%; object-fit: contain; }
.success-when {
  font-size: 18px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.success-where {
  font-size: 14px;
  color: var(--muted);
  margin-top: -8px;
}
.success-where .text-link { color: var(--ink); margin-left: 0.4em; white-space: nowrap; }
.success .btn-block { max-width: 360px; }
.success-note {
  max-width: 360px;
  font-size: 14px;
  color: var(--muted);
}
.success-note strong { color: var(--ink); font-weight: 600; }
.success-note:first-of-type { margin-top: 4px; }

/* ---------------------------------------------------------------------
   Breakpoint'ler
   --------------------------------------------------------------------- */

@media (min-width: 600px) {
  :root { --gutter: 28px; }
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .site-header { padding-top: 64px; }
}

@media (min-width: 960px) {
  .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* Desktop: ortada modal */
@media (min-width: 760px) and (min-height: 560px) {
  .sheet {
    left: 50%;
    right: auto;
    top: 50%;
    bottom: auto;
    width: min(520px, calc(100vw - 48px));
    height: min(820px, calc(100vh - 64px));
    border-radius: 6px;
    box-shadow: 0 20px 60px rgba(20, 20, 20, 0.22);
    transform: translate(-50%, calc(-50% + 16px));
    opacity: 0;
    transition: transform 260ms var(--ease), opacity 200ms var(--ease);
  }
  .sheet-root.is-open .sheet {
    transform: translate(-50%, -50%);
    opacity: 1;
  }
  .sheet-grab { cursor: default; }
  .sheet-handle { display: none; }
}

/* ---------------------------------------------------------------------
   Hareket azaltma
   --------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .card:active, .btn:active { transform: none !important; }
}
