/* Skovalle — shared stylesheet (public site + members/admin) */

:root {
  --bg: oklch(96.5% 0.013 128);
  --card: oklch(99% 0.006 100);
  --ink: oklch(23% 0.021 150);
  --ink-muted: oklch(46% 0.03 150);
  --sage: oklch(53% 0.07 148);
  --sage-deep: oklch(34% 0.06 150);
  --clay: oklch(58% 0.09 55);
  --line: oklch(88% 0.018 130);

  --hero-top: oklch(17% 0.03 152);
  --hero-bottom: oklch(10% 0.022 155);
  --hero-text: oklch(96% 0.012 95);
  --hero-muted: oklch(80% 0.02 105);
  --stream-glow: oklch(55% 0.06 165);
  --stream-line: oklch(72% 0.06 165);
  --stream-highlight: oklch(92% 0.045 160);
  --stone: oklch(64% 0.05 60);
  --reed: oklch(58% 0.06 150);
  --lake: oklch(64% 0.07 213);
  --lake-line: oklch(42% 0.06 213);
  --treeline: oklch(26% 0.035 155);
  --hill: oklch(21% 0.035 152);

  --danger: oklch(55% 0.15 25);
  --danger-bg: oklch(95% 0.03 25);
  --ok: var(--sage);
  --ok-bg: oklch(95% 0.03 148);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  -webkit-font-smoothing: antialiased;
  text-wrap: pretty;
  font-family: 'Sora', sans-serif;
  background: var(--bg);
  color: var(--ink);
  overflow-x: hidden;
  min-height: 100%;
}

body { display: flex; flex-direction: column; min-height: 100vh; }

a { color: var(--sage); text-decoration: none; }
a:hover { color: var(--sage-deep); }

@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
@keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(8px); } }
@keyframes streamDash { to { stroke-dashoffset: -480; } }
@keyframes reedSway { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg); } }
@keyframes moteRise { 0% { transform: translate(0, 0); opacity: 0; } 12% { opacity: .55; } 88% { opacity: .2; } 100% { transform: translate(14px, -150px); opacity: 0; } }
@keyframes drawIn { from { stroke-dashoffset: 200; } to { stroke-dashoffset: 0; } }

/* ---------- Header / nav (shared by every page) ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding: 20px clamp(20px, 5vw, 56px);
}

.brand {
  font-family: 'Spectral', serif;
  font-size: 21px;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: 0.02em;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(16px, 3vw, 32px);
  flex-wrap: wrap;
  font-size: 14px;
}

.site-nav a {
  text-decoration: none;
  color: var(--ink-muted);
  font-weight: 400;
}

.site-nav a.active {
  color: var(--ink);
  font-weight: 700;
  border-bottom: 1.5px solid var(--sage);
  padding-bottom: 2px;
}

.nav-divider {
  width: 1px;
  height: 14px;
  background: var(--line);
}

.lang-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  letter-spacing: 0.04em;
}

.lang-toggle button {
  background: none;
  border: none;
  font: inherit;
  cursor: pointer;
  padding: 0;
  appearance: none;
  color: var(--ink-muted);
  font-weight: 400;
}

.lang-toggle button.active {
  color: var(--ink);
  font-weight: 700;
}

.lang-toggle .dot { color: var(--line); }

/* ---------- Footer (shared) ---------- */

.site-footer {
  text-align: center;
  padding: 44px 20px 38px;
  border-top: 1px solid var(--line);
}

.site-footer .brand-mark {
  font-family: 'Spectral', serif;
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

main { flex: 1; }

/* ---------- Homepage hero ---------- */

.hero {
  position: relative;
  flex: 1;
  background: linear-gradient(180deg, var(--hero-top) 0%, var(--hero-bottom) 100%);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 20px;
}

.hero-motes { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.hero-motes span {
  position: absolute;
  border-radius: 50%;
  background: var(--hero-text);
  opacity: 0;
  filter: blur(0.4px);
  animation: moteRise ease-in-out infinite;
}

.hero-content {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  max-width: 640px;
}

.hero-content h1 {
  font-family: 'Spectral', serif;
  font-weight: 500;
  font-size: clamp(52px, 9vw, 128px);
  color: var(--hero-text);
  margin: 0;
  line-height: 1;
  letter-spacing: 0.01em;
  animation: fadeUp .9s ease-out both;
}

.hero-scroll {
  position: absolute;
  bottom: 34px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  animation: bounce 2.6s ease-in-out infinite;
}

.hero-scene {
  position: absolute;
  left: 0;
  right: 0;
  top: 60%;
  width: 100%;
  height: 30%;
  z-index: 2;
  overflow: visible;
}

.hero-stream-highlight { animation: streamDash 6.5s linear infinite; }

.reed { transform-box: fill-box; transform-origin: 50% 100%; animation: reedSway 4.6s ease-in-out infinite; }
.reed.reed-b { animation-duration: 5.2s; animation-delay: 1.3s; }

.hero-wave {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  width: 100%;
  height: clamp(36px, 5vw, 60px);
  z-index: 4;
  display: block;
}

/* ---------- Homepage link cards ---------- */

.home-cards {
  padding: clamp(70px, 11vw, 120px) clamp(20px, 6vw, 56px) clamp(70px, 9vw, 100px);
  background: var(--bg);
}

.home-cards-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  justify-content: center;
  max-width: 980px;
  margin: 0 auto;
  animation: fadeUp .8s ease-out both;
}

.home-card {
  flex: 1 1 230px;
  max-width: 300px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 34px 28px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 3px;
  text-decoration: none;
  color: var(--ink);
  transition: transform .35s ease, border-color .35s ease, box-shadow .35s ease;
}

.home-card:hover {
  transform: translateY(-5px);
  border-color: var(--sage);
  box-shadow: 0 16px 32px -18px oklch(30% 0.06 150 / 0.35);
}

.home-card-title { font-family: 'Spectral', serif; font-size: 21px; font-weight: 600; }
.home-card-line { font-size: 13.5px; color: var(--ink-muted); line-height: 1.5; }
.home-card-arrow { margin-top: 10px; font-size: 13px; color: var(--sage); }

/* ---------- Shared page hero (About / Gallery / Contact) ---------- */

.page-hero h1 {
  font-family: 'Spectral', serif;
  font-weight: 500;
  font-size: clamp(36px, 6vw, 58px);
  margin: 0 0 14px;
  color: var(--ink);
}

.page-hero-underline {
  display: block;
}

.page-hero-underline path {
  stroke-dasharray: 200;
  stroke-dashoffset: 200;
  animation: drawIn 1.3s ease-out .2s forwards;
}

/* ---------- About ---------- */

.about-section {
  padding: clamp(56px, 9vw, 96px) clamp(20px, 6vw, 56px) clamp(60px, 8vw, 90px);
  max-width: 1040px;
  margin: 0 auto;
  animation: fadeUp .7s ease-out both;
}

.about-section .page-hero-underline { margin-bottom: 40px; }

.about-grid {
  display: flex;
  gap: clamp(28px, 5vw, 64px);
  flex-wrap: wrap;
  align-items: flex-start;
}

.about-text {
  flex: 1 1 320px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  font-size: 16px;
  line-height: 1.75;
  color: var(--ink);
  max-width: 52ch;
}

.about-text p { margin: 0; }
.about-text p.muted { color: var(--ink-muted); }

.about-image { flex: 1 1 280px; max-width: 420px; }
.about-image img, .placeholder-photo {
  width: 100%;
  height: 320px;
  object-fit: cover;
  border-radius: 4px;
  display: block;
  background: var(--card);
  border: 1px solid var(--line);
}

/* ---------- Contact ---------- */

.contact-section {
  padding: clamp(80px, 12vw, 130px) 20px;
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 26px;
  animation: fadeUp .7s ease-out both;
}

.contact-heading { display: flex; flex-direction: column; align-items: center; }
.contact-line { font-size: 16px; color: var(--ink-muted); margin: 0; }

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 15px 32px;
  background: var(--sage);
  color: var(--bg);
  border: none;
  border-radius: 3px;
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: background .3s ease;
  cursor: pointer;
  font-family: inherit;
}
.btn-primary:hover { background: var(--sage-deep); color: var(--bg); }

.contact-caption {
  font-size: 12px;
  color: var(--ink-muted);
  font-style: italic;
  opacity: 0.75;
}

/* ---------- Gallery ---------- */

.gallery-section {
  padding: clamp(56px, 9vw, 96px) clamp(20px, 6vw, 56px) clamp(60px, 8vw, 90px);
  max-width: 1160px;
  margin: 0 auto;
  animation: fadeUp .7s ease-out both;
}

.gallery-section .page-hero-underline { margin-bottom: 20px; }

.gallery-subline { font-size: 15px; color: var(--ink-muted); margin: 0 0 44px; max-width: 60ch; }

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 22px;
}

.gallery-item { display: flex; flex-direction: column; gap: 10px; }
.gallery-item img, .gallery-item .placeholder-photo { height: 240px; }
.gallery-caption { font-size: 12.5px; color: var(--ink-muted); text-align: center; letter-spacing: 0.03em; }

/* ============================================================
   Members / Admin / Auth UI — same design language as the public
   site (Spectral headings, Sora body, sage/ink/line palette).
   ============================================================ */

.app-section {
  padding: clamp(40px, 6vw, 64px) clamp(20px, 6vw, 56px) 80px;
  max-width: 960px;
  margin: 0 auto;
  width: 100%;
}

.app-section.narrow { max-width: 460px; }

.app-section h1 {
  font-family: 'Spectral', serif;
  font-weight: 500;
  font-size: clamp(28px, 5vw, 40px);
  margin: 0 0 8px;
  color: var(--ink);
}

.app-subtitle { color: var(--ink-muted); margin: 0 0 32px; font-size: 15px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 28px;
  margin-bottom: 20px;
}

.card h2 {
  font-family: 'Spectral', serif;
  font-weight: 600;
  font-size: 19px;
  margin: 0 0 14px;
}

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

.resource-card {
  display: block;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 22px;
  color: var(--ink);
  transition: border-color .25s ease, transform .25s ease;
}
.resource-card:hover { border-color: var(--sage); transform: translateY(-2px); color: var(--ink); }
.resource-card .title { font-family: 'Spectral', serif; font-weight: 600; font-size: 17px; margin-bottom: 6px; }
.resource-card .desc { font-size: 13.5px; color: var(--ink-muted); line-height: 1.5; }

.form-field { margin-bottom: 18px; }
.form-field label { display: block; font-size: 13px; font-weight: 600; color: var(--ink); margin-bottom: 6px; }
.form-field .hint { display: block; font-size: 12px; color: var(--ink-muted); margin-top: 5px; font-weight: 400; }

input[type="text"], input[type="email"], input[type="password"], input[type="file"],
textarea, select {
  width: 100%;
  font: inherit;
  font-size: 15px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--bg);
  color: var(--ink);
}
input:focus, textarea:focus, select:focus { outline: 2px solid var(--sage); outline-offset: 1px; }

textarea { min-height: 140px; font-family: 'SFMono-Regular', Consolas, monospace; font-size: 13px; resize: vertical; }

.btn, .btn-primary, .btn-secondary, .btn-danger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: 3px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  border: 1px solid transparent;
  font-family: inherit;
  text-decoration: none;
}

.btn-secondary { background: var(--bg); color: var(--ink); border-color: var(--line); }
.btn-secondary:hover { border-color: var(--sage); color: var(--ink); }

.btn-danger { background: var(--danger-bg); color: var(--danger); border-color: var(--danger-bg); }
.btn-danger:hover { border-color: var(--danger); color: var(--danger); }

.btn-sm { padding: 6px 12px; font-size: 12.5px; }

.alert { padding: 13px 16px; border-radius: 3px; font-size: 14px; margin-bottom: 20px; }
.alert-error { background: var(--danger-bg); color: var(--danger); }
.alert-success { background: var(--ok-bg); color: var(--sage-deep); }

.badge { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 11px; font-weight: 600; letter-spacing: 0.03em; }
.badge-admin { background: var(--ok-bg); color: var(--sage-deep); }
.badge-member { background: var(--line); color: var(--ink-muted); }
.badge-invited { background: oklch(90% 0.06 80); color: oklch(45% 0.09 60); }
.badge-disabled { background: var(--danger-bg); color: var(--danger); }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--line); }
th { color: var(--ink-muted); font-weight: 600; font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.04em; }
tr:last-child td { border-bottom: none; }

.actions-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.config-box {
  position: relative;
  background: var(--ink);
  color: var(--hero-text);
  border-radius: 4px;
  padding: 18px;
  font-family: 'SFMono-Regular', Consolas, monospace;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-all;
  overflow-x: auto;
}

.copy-btn { position: absolute; top: 10px; right: 10px; }

.qr-box { text-align: center; padding: 20px; background: var(--card); border: 1px solid var(--line); border-radius: 4px; }
.qr-box img { max-width: 260px; width: 100%; height: auto; }

.invite-link-box {
  display: flex;
  gap: 8px;
  align-items: center;
  background: var(--bg);
  border: 1px dashed var(--line);
  border-radius: 3px;
  padding: 10px 12px;
  font-family: 'SFMono-Regular', Consolas, monospace;
  font-size: 12.5px;
  word-break: break-all;
  margin-top: 10px;
}

.plain-list { list-style: none; padding: 0; margin: 0; }
.plain-list li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.plain-list li:last-child { border-bottom: none; }

.empty-state { color: var(--ink-muted); font-size: 14px; padding: 24px 0; text-align: center; }
