/* ============================================================
   Looom – Shared styles (all pages)
   ============================================================ */

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

/* ---- Variables ---- */
:root {
  --f: 'Inter', system-ui, sans-serif;
  --bg: #F7F9F7;
  --bg-alt: #EDF0ED;
  --bg-card: #FFFFFF;
  --bg-elevated: #E8ECE8;
  --grey: #1C201C;
  --grey-dim: #4A524A;
  --grey-faint: #5F6B5F;
  --green: #247A4E;
  --green-light: #2D8A5E;
  --green-glow: rgba(36,122,78,0.12);
  --amber: #956A30;
  --amber-light: #B0813E;
  --amber-glow: rgba(196,147,90,0.12);
  --border: rgba(28,32,28,0.09);
  --border-h: rgba(28,32,28,0.18);
  --nav-bg: rgba(247,249,247,0.92);
}

[data-theme="dark"] {
  --bg: #111412;
  --bg-alt: #161A17;
  --bg-card: #1C211E;
  --bg-elevated: #232924;
  --grey: #E4EBE4;
  --grey-dim: #96A896;
  --grey-faint: #7A8E7A;
  --green: #3DAA74;
  --green-light: #52C284;
  --green-glow: rgba(61,170,116,0.18);
  --amber: #D4A870;
  --amber-light: #E0BC88;
  --amber-glow: rgba(212,168,112,0.18);
  --border: rgba(255,255,255,0.07);
  --border-h: rgba(255,255,255,0.14);
  --nav-bg: rgba(17,20,18,0.92);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111412;
    --bg-alt: #161A17;
    --bg-card: #1C211E;
    --bg-elevated: #232924;
    --grey: #E4EBE4;
    --grey-dim: #96A896;
    --grey-faint: #7A8E7A;
    --green: #3DAA74;
    --green-light: #52C284;
    --green-glow: rgba(61,170,116,0.18);
    --amber: #D4A870;
    --amber-light: #E0BC88;
    --amber-glow: rgba(212,168,112,0.18);
    --border: rgba(255,255,255,0.07);
    --border-h: rgba(255,255,255,0.14);
    --nav-bg: rgba(17,20,18,0.92);
  }
}

/* ---- Base ---- */
html { scroll-behavior: smooth; }

body {
  font-family: var(--f);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--grey);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

::selection { background: rgba(45,138,94,0.2); }
a { color: inherit; text-decoration: none; }
.container { max-width: 1280px; margin: 0 auto; padding: 0 40px; position: relative; }
.accent { color: var(--green); -webkit-text-fill-color: var(--green); }

/* ---- Buttons ---- */
.btn-p {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--f); font-size: 0.9375rem; font-weight: 500;
  padding: 12px 32px; border-radius: 9px;
  background: var(--grey); color: var(--bg);
  border: none; cursor: pointer;
  transition: all 0.2s ease;
}
.btn-p:hover { opacity: 0.85; transform: translateY(-1px); }

.btn-g {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--f); font-size: 0.9375rem; font-weight: 400;
  padding: 12px 28px; border-radius: 9px;
  color: var(--grey-dim);
  border: 1px solid var(--border);
  background: transparent;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-g:hover { border-color: var(--border-h); color: var(--grey); }
.btn-g svg { width: 14px; height: 14px; }

/* ---- Theme Toggle ---- */
.theme-toggle {
  width: 32px; height: 32px;
  border-radius: 7px;
  background: none;
  border: 1px solid var(--border);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--grey-faint);
  transition: border-color 0.2s, color 0.2s, background 0.2s;
  flex-shrink: 0;
}
.theme-toggle:hover {
  border-color: var(--border-h);
  color: var(--grey-dim);
  background: var(--bg-alt);
}
.theme-toggle svg {
  width: 14px; height: 14px;
  stroke: currentColor; fill: none;
  stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round;
}
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: none; }
.theme-toggle .icon-system { display: none; }
[data-theme-mode="light"] .theme-toggle .icon-sun { display: block; }
[data-theme-mode="dark"] .theme-toggle .icon-moon { display: block; }
[data-theme-mode="system"] .theme-toggle .icon-system { display: block; }
:root:not([data-theme-mode]) .theme-toggle .icon-system { display: block; }

/* ---- Nav ---- */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: 56px; padding: 0 40px;
  display: flex; justify-content: space-between; align-items: center;
  background: var(--nav-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.nav-left {
  display: flex; align-items: center; gap: 36px;
}

.logo {
  display: flex;
  align-items: center;
  color: var(--green);
  transition: opacity 0.2s;
}
.logo:hover { opacity: 0.7; }
.logo-svg {
  height: 32px;
  width: auto;
}

.nav-links { display: flex; gap: 24px; align-items: center; }
.nav-links > a {
  font-size: 0.8125rem;
  font-weight: 400;
  color: var(--grey-faint);
  transition: color 0.2s;
}
.nav-links > a:hover { color: var(--grey-dim); }
.nav-links > a.active { color: var(--grey); }

.nav-btn {
  font-size: 0.8125rem;
  font-weight: 500;
  padding: 7px 18px;
  border-radius: 7px;
  background: var(--grey);
  color: var(--bg);
  transition: all 0.2s;
}
.nav-btn:hover { opacity: 0.85; }

/* ---- Nav Dropdown ---- */
.nav-dropdown { position: relative; }
.nav-dropdown-trigger {
  font-size: 0.8125rem; font-weight: 400;
  color: var(--grey-faint); cursor: pointer;
  display: flex; align-items: center; gap: 4px;
  transition: color 0.2s; user-select: none;
}
.nav-dropdown-trigger:hover { color: var(--grey-dim); }
.nav-dropdown-trigger svg { width: 9px; height: 9px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.2s; }
.nav-dropdown:hover .nav-dropdown-trigger { color: var(--grey-dim); }
.nav-dropdown:hover .nav-dropdown-trigger svg { transform: rotate(180deg); }
.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 14px);
  left: 50%;
  transform: translateX(-50%) translateY(-6px);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px; padding: 8px; display: flex; flex-direction: column; gap: 4px;
  min-width: 272px; opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
  box-shadow: 0 8px 32px rgba(0,0,0,0.12), 0 0 0 1px rgba(0,0,0,0.06);
}
.nav-dropdown-menu::before {
  content: ''; position: absolute;
  top: -18px; left: 0; right: 0; height: 18px;
}
.nav-dropdown:hover .nav-dropdown-menu {
  opacity: 1; pointer-events: all;
  transform: translateX(-50%) translateY(0);
}
.nav-dropdown-label {
  font-size: 0.6875rem; font-weight: 600;
  letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--grey-faint); padding: 8px 12px 4px; display: block;
}
.nav-dropdown-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px; border-radius: 8px;
  transition: background 0.15s; cursor: pointer;
  height: 68px;
}
.nav-dropdown-item:hover { background: var(--bg-elevated); }
.nav-dropdown-item.active { background: rgba(45,138,94,0.1); }
.nav-dropdown-item.active .nav-dropdown-icon { background: rgba(45,138,94,0.15); }
.nav-dropdown-item.active .nav-dropdown-icon svg { stroke: var(--green-light); }
.nav-dropdown-icon {
  width: 30px; height: 30px; border-radius: 7px;
  background: var(--bg-elevated);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.nav-dropdown-icon svg { width: 14px; height: 14px; stroke: var(--grey-dim); fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.nav-dropdown-name { font-size: 0.8125rem; font-weight: 500; color: var(--grey); display: block; line-height: 1.3; }
.nav-dropdown-desc { font-size: 0.75rem; color: var(--grey-faint); display: block; line-height: 1.3; margin-top: 1px; }

/* ---- Mobile Nav ---- */
.nav-hamburger {
  display: none;
  width: 32px; height: 32px;
  border-radius: 7px;
  background: none;
  border: 1px solid var(--border);
  cursor: pointer;
  align-items: center; justify-content: center;
  color: var(--grey-faint);
  transition: border-color 0.2s, color 0.2s;
  flex-shrink: 0;
}
.nav-hamburger:hover { border-color: var(--border-h); color: var(--grey-dim); }
.nav-hamburger svg {
  width: 14px; height: 14px;
  stroke: currentColor; fill: none;
  stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round;
}
.nav-hamburger .icon-close { display: none; }
.nav-hamburger.open .icon-menu { display: none; }
.nav-hamburger.open .icon-close { display: block; }

.mobile-menu {
  display: none;
  position: fixed;
  top: 56px; left: 0; right: 0; bottom: 0;
  z-index: 99;
  background: var(--bg);
  padding: 24px 32px;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
}
.mobile-menu.open { display: flex; }
.mobile-menu a {
  display: block;
  padding: 14px 16px;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--grey);
  border-radius: 10px;
  transition: background 0.15s;
}
.mobile-menu a:hover { background: var(--bg-alt); }
.mobile-menu .mobile-divider {
  height: 1px;
  background: var(--border);
  margin: 8px 0;
}
.mobile-menu .mobile-cta {
  display: block;
  text-align: center;
  margin-top: 16px;
  padding: 14px 24px;
  background: var(--grey);
  color: var(--bg);
  border-radius: 9px;
  font-size: 0.9375rem;
  font-weight: 500;
  transition: opacity 0.2s;
}
.mobile-menu .mobile-cta:hover { opacity: 0.85; background: var(--grey); }

/* ---- Cookie Banner ---- */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 200;
  padding: 16px 24px;
  background: var(--nav-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.16,1,0.3,1);
}
.cookie-banner.show {
  transform: translateY(0);
}
.cookie-banner p {
  font-size: 0.8125rem;
  color: var(--grey-dim);
  line-height: 1.5;
}
.cookie-banner a {
  color: var(--grey);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.cookie-banner a:hover {
  color: var(--green-light);
}
.cookie-btns {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.cookie-accept {
  font-family: var(--f);
  font-size: 0.75rem;
  font-weight: 500;
  padding: 8px 20px;
  border-radius: 7px;
  background: var(--grey);
  color: var(--bg);
  border: none;
  cursor: pointer;
  transition: opacity 0.2s;
}
.cookie-accept:hover { opacity: 0.85; }

/* ---- Footer ---- */
footer {
  padding: 32px 0;
  border-top: 1px solid var(--border);
}
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.footer-bottom span {
  font-size: 0.8125rem;
  color: var(--grey-faint);
}
.footer-bottom a {
  font-size: 0.8125rem;
  color: var(--grey-faint);
  transition: color 0.2s;
}
.footer-bottom a:hover { color: var(--grey-dim); }

/* ---- Shared Responsive ---- */
@media (max-width: 900px) {
  .nav-links { display: none; }
  .nav-hamburger { display: flex; }
  .container { padding: 0 24px; }
}

@media (max-width: 600px) {
  .cookie-banner { flex-direction: column; gap: 12px; text-align: center; padding: 20px 24px; }
  .footer-bottom { flex-direction: column; gap: 12px; text-align: center; }
}
