/* =========================================================================
   Design tokens
   ========================================================================= */
:root {
  --ink: #14161b;
  --ink-soft: #4a4e57;
  --muted: #8a8f99;
  --line: #e7e9ed;
  --bg: #ffffff;
  --bg-alt: #f6f7f9;
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --on-accent: #ffffff;

  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(20, 22, 27, .06), 0 12px 32px rgba(20, 22, 27, .06);
  --maxw: 1160px;

  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
}

/* =========================================================================
   Base
   ========================================================================= */
* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

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

a { color: inherit; text-decoration: none; }

h1, h2, h3 { font-family: var(--font-display); font-weight: 600; letter-spacing: -.02em; margin: 0; }

p { margin: 0; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* =========================================================================
   Buttons
   ========================================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .72rem 1.35rem;
  border-radius: 999px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: .95rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, transform .05s ease;
}
.btn:active { transform: translateY(1px); }

.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); }

.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--bg-alt); }

.btn-danger { background: #fff; color: #b42318; border-color: #f3c6c0; }
.btn-danger:hover { background: #fef3f2; }

/* =========================================================================
   Navigation
   ========================================================================= */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, .82);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: .9rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}
.nav-links { display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; }
.nav-link {
  padding: .5rem .85rem;
  border-radius: 8px;
  color: var(--ink-soft);
  font-weight: 500;
  font-size: .95rem;
  transition: background .15s ease, color .15s ease;
}
.nav-link:hover { background: var(--bg-alt); color: var(--ink); }

.brand { display: inline-flex; align-items: center; }
.brand-logo { height: 30px; width: auto; }
.brand-text {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
  letter-spacing: -.02em;
}

/* =========================================================================
   Hero
   ========================================================================= */
.hero {
  position: relative;
  min-height: 460px;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: flex-end;
  color: #fff;
}
.hero-overlay {
  max-width: var(--maxw);
  margin: 0 auto;
  width: 100%;
  padding: 3.5rem 1.5rem 3.5rem;
}
.hero-title {
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 1.04;
  max-width: 15ch;
  color: #fff;
}
.hero-text {
  margin-top: 1rem;
  max-width: 46ch;
  font-size: 1.08rem;
  color: rgba(255, 255, 255, .88);
}
.hero .btn { margin-top: 1.6rem; }

/* =========================================================================
   Sections
   ========================================================================= */
.section {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 5rem 1.5rem;
}
.section-title { font-size: clamp(1.5rem, 3vw, 2.1rem); }
.section-text { margin-top: .9rem; color: var(--ink-soft); max-width: 60ch; font-size: 1.05rem; }

/* Cards: three cells */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg);
  transition: box-shadow .18s ease, transform .18s ease;
}
.card:hover { box-shadow: var(--shadow); transform: translateY(-3px); }
.card-media { aspect-ratio: 4 / 3; background: var(--bg-alt); }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.card-title { font-size: 1.2rem; padding: 1.15rem 1.25rem 0; }
.card-text { padding: .5rem 1.25rem 1.5rem; color: var(--ink-soft); }

/* Split: wide image + narrow image + copy */
.split {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 2.5rem;
  align-items: center;
}
.split-media {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1rem;
  height: 100%;
}
.split-media img { width: 100%; height: 100%; object-fit: cover; border-radius: var(--radius); }
.split-wide { min-height: 340px; }
.split-narrow { min-height: 340px; }

/* Plain text block (pages 2 and 3) */
.text-block { padding-top: 4rem; padding-bottom: 5rem; }
.text-inner { max-width: 760px; }

/* =========================================================================
   Footer
   ========================================================================= */
.site-footer {
  border-top: 1px solid var(--line);
  background: var(--bg-alt);
  margin-top: 2rem;
}
.footer-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.footer-links { display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; }
.footer-secret { cursor: pointer; user-select: none; }

/* =========================================================================
   Responsive
   ========================================================================= */
@media (max-width: 860px) {
  .cards-grid { grid-template-columns: 1fr; }
  .split { grid-template-columns: 1fr; }
  .split-media { grid-template-columns: 2fr 1fr; }
  .nav-inner { flex-direction: column-reverse; align-items: stretch; gap: .75rem; }
  .nav-links { justify-content: center; }
  .brand { justify-content: center; }
  .footer-inner { flex-direction: column; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* =========================================================================
   Admin panel
   ========================================================================= */
.admin-body { background: var(--bg-alt); }

.admin-shell { max-width: 940px; margin: 0 auto; padding: 2.5rem 1.5rem 4rem; }

.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.75rem;
  flex-wrap: wrap;
}
.admin-topbar h1 { font-size: 1.4rem; }
.admin-actions { display: flex; gap: .6rem; flex-wrap: wrap; }

/* Login */
.login-card {
  max-width: 400px;
  margin: 12vh auto 0;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2rem;
}
.login-card h1 { font-size: 1.35rem; margin-bottom: .35rem; }
.login-card p { color: var(--muted); font-size: .9rem; margin-bottom: 1.4rem; }
.login-error { color: #b42318; font-size: .88rem; margin-top: .75rem; min-height: 1.1rem; }

/* Tabs */
.tabs { display: flex; gap: .4rem; border-bottom: 1px solid var(--line); margin-bottom: 1.75rem; flex-wrap: wrap; }
.tab {
  padding: .65rem 1rem;
  border: none;
  background: none;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: .95rem;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tab:hover { color: var(--ink); }
.tab.is-active { color: var(--accent); border-bottom-color: var(--accent); }

.panel { display: none; }
.panel.is-active { display: block; }

/* Cards inside admin */
.group {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}
.group h2 { font-size: 1.05rem; margin-bottom: 1.1rem; }
.group h3 { font-size: .85rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 1.5rem 0 .75rem; }

.field { margin-bottom: 1rem; }
.field label { display: block; font-size: .85rem; font-weight: 600; color: var(--ink-soft); margin-bottom: .35rem; }
.field input[type="text"],
.field input[type="password"],
.field textarea {
  width: 100%;
  padding: .6rem .75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: .95rem;
  color: var(--ink);
  background: var(--bg);
}
.field textarea { min-height: 90px; resize: vertical; }
.field input:focus, .field textarea:focus { border-color: var(--accent); outline: none; }

.row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 620px) { .row { grid-template-columns: 1fr; } }

/* Image field */
.image-field { display: flex; gap: 1rem; align-items: flex-start; }
.image-preview {
  width: 92px;
  height: 68px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  object-fit: cover;
  background: var(--bg-alt);
  flex: none;
}
.image-controls { flex: 1; display: flex; flex-direction: column; gap: .5rem; }
.file-btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-size: .85rem;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
}
.file-btn input { display: none; }

/* Toast */
.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink);
  color: #fff;
  padding: .7rem 1.2rem;
  border-radius: 999px;
  font-size: .9rem;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  z-index: 50;
}
.toast.is-visible { opacity: 1; transform: translateX(-50%) translateY(0); }

.hint { font-size: .82rem; color: var(--muted); margin-top: .4rem; }
