/* ─── Reset ─────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ─── Design tokens ──────────────────────────── */
:root {
  --ink:    #0a0b0f;
  --panel:  #111520;
  --panel2: #161c2c;
  --paper:  #f4f2ee;
  --gold:   #c9a96e;
  --gold2:  #e8d5b0;
  --dim:    #5a5a60;
  --muted:  #9099b0;
  --line:   rgba(201,169,110,.14);
  --line2:  rgba(255,255,255,.07);
  --r-sm:   10px;
  --r-md:   14px;
  --r-lg:   18px;
  --nav-h:  56px;
}

/* ─── Base (mobile-first) ────────────────────── */
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  background: var(--ink);
  color: var(--paper);
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
  font-size: 16px;
  overflow-x: hidden;
}

/* ─── Nav bar ────────────────────────────────── */
.site-nav-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 200;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
  background: rgba(10,11,15,.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line2);
}

.nav-brand {
  font-weight: 700;
  font-size: 1rem;
  color: var(--paper);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: .55rem;
  height: 44px;
  -webkit-tap-highlight-color: transparent;
}

.nav-logo {
  height: 22px;
  width: auto;
  object-fit: contain;
  opacity: .88;
}

.nav-sep {
  width: 1px;
  height: 14px;
  background: var(--line2);
  flex-shrink: 0;
}

.nav-sub {
  font-size: .88rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: .04em;
}

.nav-label {
  font-size: .75rem;
  font-weight: 400;
  color: var(--muted);
}

.nav-back {
  font-size: .82rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  height: 44px;
  padding: 0 .25rem;
  transition: color .2s;
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
}

.nav-back:active { color: var(--paper); }

@media (hover: hover) {
  .nav-back:hover { color: var(--paper); }
}

/* ─── Category chips (sticky below nav) ─────── */
.cat-chips-wrap {
  position: sticky;
  top: var(--nav-h);
  z-index: 100;
  background: rgba(10,11,15,.97);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line2);
}

.cat-chips {
  display: flex;
  gap: .45rem;
  overflow-x: auto;
  padding: .6rem 1rem .65rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}

.cat-chips::-webkit-scrollbar { display: none; }

.cat-chip {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: 0 .9rem;
  height: 36px;
  border-radius: 999px;
  border: 1px solid var(--line2);
  background: var(--panel);
  color: var(--muted);
  font-family: inherit;
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, color .15s, border-color .15s;
  -webkit-tap-highlight-color: transparent;
  min-height: 36px;
}

.cat-chip:active {
  background: rgba(201,169,110,.15);
  border-color: rgba(201,169,110,.35);
  color: var(--gold2);
}

.cat-chip.active {
  background: var(--gold);
  color: #12100a;
  border-color: var(--gold);
  font-weight: 700;
}

/* ─── Page wrapper ───────────────────────────── */
.page-wrap {
  padding-top: var(--nav-h);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding-bottom: env(safe-area-inset-bottom, 1rem);
}

/* ─── Hero (compact on mobile) ───────────────── */
.hero {
  padding: 1.6rem 1rem 1.2rem;
  animation: rise .5s cubic-bezier(.22,1,.36,1) .05s both;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: .75rem;
}

.hero h1 {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -.03em;
  margin-bottom: .7rem;
  color: var(--paper);
}

.hero h1 em {
  font-style: normal;
  background: linear-gradient(90deg, var(--gold), var(--gold2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-desc {
  font-size: .95rem;
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 1.1rem;
  max-width: 52ch;
}

/* ─── Search bar ─────────────────────────────── */
.search-wrap {
  position: relative;
  margin-bottom: .5rem;
}

.search-icon {
  position: absolute;
  left: .95rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--dim);
  pointer-events: none;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.search-input {
  width: 100%;
  height: 52px;
  background: var(--panel);
  border: 1.5px solid var(--line2);
  border-radius: 999px;
  color: var(--paper);
  font-family: inherit;
  font-size: 16px; /* prevents iOS zoom */
  font-weight: 400;
  padding: 0 3rem 0 2.8rem;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
  -webkit-appearance: none;
  appearance: none;
}

.search-input::placeholder { color: var(--dim); }
.search-input:focus {
  border-color: rgba(201,169,110,.5);
  box-shadow: 0 0 0 3px rgba(201,169,110,.1);
}

/* Remove default search cancel button */
.search-input::-webkit-search-cancel-button { display: none; }

.search-clear {
  position: absolute;
  right: .6rem;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--panel2);
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  -webkit-tap-highlight-color: transparent;
  transition: background .15s, color .15s;
}

.search-clear:active { background: var(--line2); color: var(--paper); }

.search-empty {
  text-align: center;
  color: var(--muted);
  font-size: .9rem;
  padding: 2rem 1rem;
}

/* ─── Sections ───────────────────────────────── */
.calc-section {
  padding: 0 1rem 1.5rem;
}

.section-label {
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: .9rem;
  display: flex;
  align-items: center;
  gap: .6rem;
  padding-top: 1.25rem;
}

.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* ─── Calculator grid (mobile = 1 col list) ──── */
.calc-grid {
  display: flex;
  flex-direction: column;
  gap: .6rem;
}

/* ─── Calculator card (mobile = horizontal row) */
.calc-card {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: .85rem;
  background: var(--panel);
  border: 1px solid var(--line2);
  border-radius: var(--r-md);
  padding: .95rem 1rem;
  text-decoration: none;
  color: inherit;
  min-height: 68px;
  transition: border-color .15s, background .15s;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  overflow: hidden;
}

.calc-card:active {
  background: var(--panel2);
  border-color: rgba(201,169,110,.25);
}

.calc-card-icon {
  font-size: 1.65rem;
  line-height: 1;
  flex-shrink: 0;
  width: 38px;
  text-align: center;
}

.calc-card-body {
  flex: 1;
  min-width: 0;
}

.calc-card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--paper);
  line-height: 1.3;
  margin-bottom: .18rem;
}

.calc-card-desc {
  font-size: .82rem;
  color: var(--muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.calc-card-chevron {
  flex-shrink: 0;
  color: var(--gold);
  opacity: .7;
  transition: opacity .15s, transform .15s;
}

@media (hover: hover) {
  .calc-card:hover {
    border-color: rgba(201,169,110,.3);
    background: rgba(255,255,255,.02);
  }
  .calc-card:hover .calc-card-chevron {
    opacity: 1;
    transform: translateX(2px);
  }
}

/* ─── Info strip ─────────────────────────────── */
.info-strip {
  background: var(--panel2);
  border: 1px solid var(--line2);
  border-radius: var(--r-lg);
  padding: 1.1rem 1.15rem;
  margin: 0 1rem 1.5rem;
  font-size: .875rem;
  line-height: 1.75;
  color: var(--muted);
}

.info-strip strong { color: var(--paper); font-weight: 600; }
.info-strip a { color: var(--gold); text-decoration: none; }

/* ─── FAQ ────────────────────────────────────── */
.faq-section { padding: 0 1rem 1.5rem; }

.faq { display: flex; flex-direction: column; gap: .5rem; }

.faq-item {
  background: var(--panel);
  border: 1px solid var(--line2);
  border-radius: var(--r-md);
  overflow: hidden;
}

.faq-item summary {
  font-weight: 600;
  font-size: .92rem;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .75rem;
  min-height: 56px;
  padding: .85rem 1.1rem;
  color: var(--paper);
  -webkit-tap-highlight-color: transparent;
  transition: background .15s;
  line-height: 1.35;
}

.faq-item summary:active { background: var(--panel2); }
.faq-item summary::-webkit-details-marker { display: none; }

.faq-chevron {
  flex-shrink: 0;
  color: var(--gold);
  transition: transform .2s;
}

.faq-item[open] .faq-chevron { transform: rotate(90deg); }

.faq-item p {
  padding: 0 1.1rem 1rem;
  font-size: .875rem;
  color: var(--muted);
  line-height: 1.75;
}

/* ─── Footer ─────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--line2);
  padding: 1.2rem 1rem;
  padding-bottom: max(1.2rem, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: .75rem;
  font-size: .75rem;
  color: var(--dim);
  letter-spacing: .04em;
  margin-top: auto;
}

.footer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.site-footer a { color: var(--dim); text-decoration: none; }

.footer-disclaimer {
  font-size: .7rem;
  color: var(--dim);
  line-height: 1.7;
  padding-top: .75rem;
  border-top: 1px solid var(--line2);
}

/* ─── Keyframes ──────────────────────────────── */
@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ═══════════════════════════════════════════════
   TABLET (≥ 600px) — 2-col grid, vertical cards
═══════════════════════════════════════════════ */
@media (min-width: 600px) {
  .site-nav-bar { padding: 0 1.5rem; }

  .hero {
    padding: 2.2rem 1.5rem 1.4rem;
    max-width: 860px;
    margin: 0 auto;
    width: 100%;
  }

  .hero h1 { font-size: 2.6rem; }

  .cat-chips { padding: .65rem 1.5rem .7rem; }

  .calc-section {
    padding: 0 1.5rem 2rem;
    max-width: 860px;
    margin: 0 auto;
    width: 100%;
  }

  .calc-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: .75rem;
  }

  .calc-card {
    flex-direction: column;
    align-items: flex-start;
    min-height: 160px;
    padding: 1.2rem;
    gap: .5rem;
  }

  .calc-card-icon { width: auto; font-size: 1.5rem; }

  .calc-card-desc {
    -webkit-line-clamp: unset;
    overflow: visible;
    display: block;
    font-size: .83rem;
  }

  .calc-card-chevron {
    display: none; /* arrow not needed on vertical card */
  }

  .calc-card-body { flex: none; width: 100%; }

  /* Restore desktop-style bottom arrow */
  .calc-card::after {
    content: 'Hesapla →';
    display: block;
    margin-top: auto;
    padding-top: .6rem;
    font-size: .75rem;
    font-weight: 700;
    color: var(--gold);
    letter-spacing: .03em;
    opacity: 0;
    transition: opacity .2s;
  }

  @media (hover: hover) {
    .calc-card:hover::after { opacity: 1; }
  }

  .info-strip {
    margin: 0 1.5rem 2rem;
    max-width: calc(860px - 3rem);
    margin-left: auto;
    margin-right: auto;
  }

  .faq-section {
    padding: 0 1.5rem 2rem;
    max-width: 860px;
    margin: 0 auto;
    width: 100%;
  }

  .site-footer {
    padding: 1.4rem 1.5rem;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
  }

  .footer-row { flex: none; }
  .footer-disclaimer { width: 100%; padding-top: .75rem; }
}

/* ═══════════════════════════════════════════════
   DESKTOP (≥ 900px) — 4-col grid
═══════════════════════════════════════════════ */
@media (min-width: 900px) {
  .hero { padding: 3rem 2.5rem 2rem; }
  .hero h1 { font-size: 3.2rem; }

  .calc-section { padding: 0 2.5rem 2.5rem; }

  .calc-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  }

  .info-strip { margin: 0 2.5rem 2.5rem; }
  .faq-section { padding: 0 2.5rem 2.5rem; }
  .site-footer { padding: 1.4rem 2.5rem; }
}
