/* Repupa davet sayfası. Renk, yarıçap ve yazı ölçüleri design/canvas/project/repupa.css ve
   repupa/repupa/Design/Tokens.swift ile aynı. Yazı tipleri yerel (assets/fonts): üçüncü taraf isteği yok. */

@font-face {
  font-family: "Cal Sans";
  src: url("/assets/fonts/CalSans-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "DM Sans";
  src: url("/assets/fonts/DMSans-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "DM Sans";
  src: url("/assets/fonts/DMSans-Medium.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "DM Sans";
  src: url("/assets/fonts/DMSans-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ---------------------------------------------------------------- jetonlar */
:root {
  /* marka paleti (Tokens.swift) */
  --rp-neutral-950: #12100c;
  --rp-neutral-900: #1c1915;
  --rp-neutral-800: #2a2620;
  --rp-neutral-700: #3a342b;
  --rp-neutral-400: #a9a091;
  --rp-cream: #fbf8f0;
  --rp-surface: #ffffff;
  --rp-border: #f0ebe0;
  --rp-border-strong: #d9d2c4;
  --rp-text-secondary: #5c554a;
  --rp-lavender: #ddd6fe;
  --rp-lavender-ink: #3f3a55;
  --rp-accent: #6d5bd0;
  --rp-ios-blue: #0091ff;
  --rp-error: #d70015;

  --rp-radius-lg: 12px;
  --rp-radius-xl: 16px;
  --rp-radius-2xl: 24px;
  --rp-radius-full: 999px;
  --rp-btn-h: 54px;
  --rp-gutter: 20px;

  --rp-font-display: "Cal Sans", "DM Sans", system-ui, sans-serif;
  --rp-font-body: "DM Sans", system-ui, -apple-system, sans-serif;

  /* açık tema (cream ekranlar) */
  --bg: var(--rp-cream);
  --surface: var(--rp-surface);
  --line: var(--rp-border);
  --line-strong: var(--rp-border-strong);
  --text: var(--rp-neutral-950);
  --text-2: var(--rp-text-secondary);
  --selected-bg: var(--rp-neutral-950);
  --selected-text: #ffffff;
  --primary-bg: var(--rp-neutral-950);
  --primary-text: #ffffff;
  --track: rgba(18, 16, 12, 0.1);
  --focus: var(--rp-ios-blue);
  --error: var(--rp-error);

  color-scheme: light dark;
}

/* Sistem koyu modu: cream ekranlar koyu yüzeye döner (koyu tasarım ekranlarının renkleri). */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: var(--rp-neutral-950);
    --surface: var(--rp-neutral-900);
    --line: var(--rp-neutral-800);
    --line-strong: var(--rp-neutral-700);
    --text: var(--rp-cream);
    --text-2: var(--rp-neutral-400);
    --selected-bg: var(--rp-cream);
    --selected-text: var(--rp-neutral-950);
    --primary-bg: var(--rp-cream);
    --primary-text: var(--rp-neutral-950);
    --track: rgba(251, 248, 240, 0.14);
    --error: #ff6961;
  }
}

/* Marka ekranları (giriş, teşekkür) her zaman koyu: light lockup yalnız koyu yüzeyde kullanılır. */
body[data-theme="brand"] {
  --bg: var(--rp-neutral-950);
  --surface: var(--rp-neutral-900);
  --line: rgba(255, 255, 255, 0.16);
  --line-strong: rgba(255, 255, 255, 0.28);
  --text: #ffffff;
  --text-2: var(--rp-neutral-400);
  --selected-bg: var(--rp-cream);
  --selected-text: var(--rp-neutral-950);
  --primary-bg: #ffffff;
  --primary-text: var(--rp-neutral-950);
  --track: rgba(255, 255, 255, 0.16);
  --error: #ff6961;
}

/* ---------------------------------------------------------------- temel */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
/* iOS Safari: rem birimleri Dynamic Type ayarıyla büyüsün. */
@supports (font: -apple-system-body) {
  html {
    font: -apple-system-body;
  }
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--rp-font-body);
  font-size: 1rem;
  line-height: 1.35;
  letter-spacing: -0.02em;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.2s ease;
}

img {
  display: block;
  max-width: 100%;
}

button,
a {
  font: inherit;
  letter-spacing: inherit;
  color: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

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

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------------------------------------------------------------- ekran */
.screen {
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding: max(env(safe-area-inset-top), 20px) var(--rp-gutter) max(env(safe-area-inset-bottom), 24px);
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.screen.enter {
  animation: rp-enter 0.32s cubic-bezier(0.32, 0.72, 0, 1) both;
}
@keyframes rp-enter {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.stack-sm {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bottom {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.logo {
  width: 132px; /* yatay lockup için en küçük boyut 120 pt */
  height: auto;
  margin: 12px 0 8px;
}

.eyebrow {
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.33;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-2);
}

.h1 {
  margin: 0;
  font-family: var(--rp-font-display);
  font-weight: 400;
  font-size: 1.75rem;
  line-height: 1.2;
  letter-spacing: 0.01em;
  overflow-wrap: anywhere;
}
/* Başlık yalnız ekran değişince odak hedefi (tabindex=-1); etkileşimli değil, halka göstermez. */
.h1:focus,
.h1:focus-visible {
  outline: none;
}
.h1--xl {
  font-size: 2.125rem;
}

.p {
  margin: 0;
  font-size: 1rem;
  line-height: 1.32;
  color: var(--text-2);
}
.small {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.38;
  color: var(--text-2);
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.meta li {
  padding: 6px 12px;
  border-radius: var(--rp-radius-full);
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 0.8125rem;
  line-height: 1.25;
  font-weight: 500;
}

/* ---------------------------------------------------------------- düğmeler */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: var(--rp-btn-h);
  padding: 14px 24px;
  border-radius: var(--rp-radius-full);
  border: 1px solid transparent;
  background: var(--primary-bg);
  color: var(--primary-text);
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.btn:active {
  transform: scale(0.98);
}
.btn[disabled],
.btn[aria-disabled="true"] {
  opacity: 0.42;
  cursor: not-allowed;
  transform: none;
}
.btn--lavender {
  background: var(--rp-lavender);
  color: var(--rp-neutral-950);
}
.btn--ghost {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--text);
  font-weight: 500;
}

.link-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 8px 12px;
  border: 0;
  background: none;
  color: var(--text-2);
  font-size: 0.9375rem;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  border-radius: var(--rp-radius-lg);
}

/* ---------------------------------------------------------------- yakınlık seçenekleri (marka ekranı) */
.choices {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.choice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 54px;
  padding: 12px 18px;
  border-radius: var(--rp-radius-full);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font-size: 1rem;
  line-height: 1.25;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.choice:hover {
  border-color: var(--line-strong);
}
.choice .chev {
  flex: none;
  opacity: 0.6;
}

/* ---------------------------------------------------------------- soru ekranı */
.qhead {
  display: flex;
  align-items: center;
  gap: 12px;
}
.back {
  flex: none;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}
.qcount {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.875rem;
  line-height: 1.3;
  font-weight: 500;
  color: var(--text-2);
}
.progress {
  height: 4px;
  border-radius: 2px;
  background: var(--track);
  overflow: hidden;
}
.progress > span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 2px;
  background: var(--text);
  transition: width 0.3s ease;
}

.options {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.options--pair {
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.options--grid {
  grid-template-columns: 1fr 1fr;
}

.opt {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  height: 100%;
  min-height: 52px;
  padding: 12px 16px;
  border-radius: var(--rp-radius-xl);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font-size: 1rem;
  line-height: 1.25;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.opt .emoji {
  flex: none;
  font-size: 1.25rem;
  line-height: 1;
}
.opt[aria-pressed="true"] {
  background: var(--selected-bg);
  border-color: var(--selected-bg);
  color: var(--selected-text);
}
.opt--muted {
  color: var(--text-2);
  background: transparent;
  border-style: dashed;
}
.options--pair .opt {
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  min-height: 132px;
  padding: 18px 16px;
  font-size: 0.9375rem;
}
.options--pair .opt .emoji {
  font-size: 2.125rem;
}
.options--grid .opt {
  min-height: 52px;
  padding: 10px 14px;
  font-size: 0.9375rem;
}

/* ---------------------------------------------------------------- kutular */
.box {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  border-radius: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
}
.box--lavender {
  background: var(--rp-lavender);
  border-color: var(--rp-lavender);
  color: var(--rp-neutral-950);
}
.box--lavender .eyebrow,
.box--lavender .p {
  color: var(--rp-lavender-ink);
}
.box--lavender .btn {
  background: var(--rp-neutral-950);
  color: #ffffff;
}

.alert {
  margin: 0;
  padding: 12px 14px;
  border-radius: var(--rp-radius-lg);
  border: 1px solid var(--error);
  color: var(--error);
  font-size: 0.9375rem;
  line-height: 1.3;
}

/* ---------------------------------------------------------------- bekleme */
.center {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  text-align: center;
}
.spinner {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 3px solid var(--track);
  border-top-color: var(--text);
  animation: rp-spin 0.9s linear infinite;
}
@keyframes rp-spin {
  to {
    transform: rotate(360deg);
  }
}

.icon {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------------------------------------------------------------- hareket azaltma */
@media (prefers-reduced-motion: reduce) {
  /* uzamsal hareket yok, yalnız opaklık geçişi */
  .screen.enter {
    animation: rp-fade 0.2s ease both;
  }
  .btn:active {
    transform: none;
  }
  .progress > span {
    transition: none;
  }
  .spinner {
    animation: none;
    border-top-color: var(--track);
    border-color: var(--text-2);
    opacity: 0.6;
  }
  body {
    transition: none;
  }
}
@keyframes rp-fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@media (forced-colors: active) {
  .opt[aria-pressed="true"] {
    outline: 3px solid Highlight;
  }
}

/* Çok dar ekran ya da büyük yazı: ikili seçenekler alt alta. */
@media (max-width: 340px) {
  .options--pair,
  .options--grid {
    grid-template-columns: 1fr;
  }
  .options--pair .opt {
    min-height: 64px;
    flex-direction: row;
    align-items: center;
  }
  .options--pair .opt .emoji {
    font-size: 1.5rem;
  }
}
