/* ============================================================
   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: #F8F7F5;
  --bg-alt: #F0EFEB;
  --bg-card: #FFFFFF;
  --bg-elevated: #EAE8E4;
  --grey: #1E1D1B;
  --grey-dim: #52504A;
  --grey-faint: #6B6860;
  --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);
  --blue: #4A6B8A;
  --blue-light: #5A7D9E;
  --blue-glow: rgba(74,107,138,0.12);
  --border: rgba(30,29,27,0.10);
  --border-h: rgba(30,29,27,0.20);
  --nav-bg: rgba(255,255,255,0.82);
}

[data-theme="dark"] {
  --bg: #131210;
  --bg-alt: #1A1815;
  --bg-card: #1F1D1A;
  --bg-elevated: #272521;
  --grey: #EAE8E3;
  --grey-dim: #A09D94;
  --grey-faint: #8A8780;
  --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);
  --blue: #6B9BC4;
  --blue-light: #82AED4;
  --blue-glow: rgba(107,155,196,0.18);
  --border: rgba(255,255,255,0.08);
  --border-h: rgba(255,255,255,0.15);
  --nav-bg: rgba(19,18,16,0.92);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #131210;
    --bg-alt: #1A1815;
    --bg-card: #1F1D1A;
    --bg-elevated: #272521;
    --grey: #EAE8E3;
    --grey-dim: #A09D94;
    --grey-faint: #8A8780;
    --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);
    --blue: #6B9BC4;
    --blue-light: #82AED4;
    --blue-glow: rgba(107,155,196,0.18);
    --border: rgba(255,255,255,0.08);
    --border-h: rgba(255,255,255,0.15);
    --nav-bg: rgba(19,18,16,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; }

/* ---- Focus ---- */
:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}
input:focus-visible {
  outline-offset: 0;
}
.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: 20px; left: 50%; transform: translateX(-50%); z-index: 100;
  width: calc(100% - 32px); max-width: 1280px;
  height: 60px; padding: 0 16px 0 28px;
  display: flex; justify-content: space-between; align-items: center;
  background: var(--nav-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 2px 16px rgba(0,0,0,0.06), 0 0 0 0.5px rgba(0,0,0,0.03);
}

.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(--green);
  color: #fff;
  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: 72px; left: 16px; right: 16px; bottom: 16px;
  z-index: 99;
  background: var(--nav-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px 24px;
  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; }
}

/* ---- CTA ---- */
.cta .btn-p { background: var(--green); color: #fff; }
.article-cta .btn-p { background: var(--green); color: #fff; }

/* ---- Big Logo ---- */
.big-logo-section {
  padding: 80px 0; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.big-logo-wrap {
  width: 160%; max-width: none; margin: 0 -30%;
  display: flex; align-items: center; justify-content: center;
}
.big-logo-svg { width: 100%; height: auto; color: var(--text); opacity: 0.06; }

/* ---- Waitlist Modal ---- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}
.modal-backdrop.open { opacity: 1; visibility: visible; }
.modal-card {
  background: #fff; border-radius: 20px;
  padding: 64px 56px 56px; max-width: 540px; width: calc(100% - 40px);
  text-align: center; position: relative;
  box-shadow: 0 24px 80px rgba(0,0,0,0.2), 0 0 0 1px rgba(0,0,0,0.05);
  transform: translateY(16px) scale(0.97); transition: transform 0.25s ease;
}
.modal-backdrop.open .modal-card { transform: translateY(0) scale(1); }
.modal-close {
  position: absolute; top: 16px; right: 16px; width: 32px; height: 32px;
  border: none; background: rgba(0,0,0,0.06); border-radius: 50%;
  color: rgba(0,0,0,0.4); font-size: 18px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: background 0.15s;
}
.modal-close:hover { background: rgba(0,0,0,0.1); }
.modal-logo { height: 48px; width: auto; color: var(--green); margin-bottom: 32px; }
.modal-card h2 {
  font-size: clamp(1.5rem, 3.5vw, 2rem); font-weight: 700;
  letter-spacing: -0.035em; line-height: 1.1; color: #111; margin-bottom: 12px;
}
.modal-card p { font-size: 0.875rem; color: rgba(0,0,0,0.5); margin-bottom: 28px; line-height: 1.5; }
.waitlist-form {
  display: flex;
  gap: 8px;
  max-width: 440px;
  margin: 0 auto;
}
.waitlist-form input {
  flex: 1;
  font-family: var(--f);
  font-size: 0.8125rem;
  font-weight: 400;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid rgba(0,0,0,0.12);
  background: #F7F9F7;
  color: #111;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.waitlist-form input::placeholder { color: rgba(0,0,0,0.3); }
.waitlist-form input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(36,122,78,0.1); }
.waitlist-form button:disabled { opacity: 0.6; cursor: not-allowed; }
.waitlist-msg { margin-top: 12px; font-size: 0.8125rem; text-align: center; }
.waitlist-msg.success { color: #247A4E; }
.waitlist-msg.error { color: var(--amber-light); }
.modal-card .waitlist-form {
  flex-direction: row;
}
.modal-card .waitlist-form input {
  flex: 1; border-color: rgba(0,0,0,0.12); background: #F7F9F7; color: #111;
}
.modal-card .waitlist-form input::placeholder { color: rgba(0,0,0,0.3); }
.modal-card .waitlist-form input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(36,122,78,0.1); }
.modal-card .btn-p { background: var(--green); color: #fff; white-space: nowrap; }
.modal-card .btn-p:hover { background: #1d6940; }
.modal-card .waitlist-msg { color: rgba(0,0,0,0.5); }
.modal-card .waitlist-msg.success { color: #247A4E; }
.modal-card .waitlist-msg.error { color: var(--amber-light); }

[data-theme="dark"] .modal-card { background: #1A1815; box-shadow: 0 24px 80px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.06); }
[data-theme="dark"] .modal-close { background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.5); }
[data-theme="dark"] .modal-close:hover { background: rgba(255,255,255,0.14); }
[data-theme="dark"] .modal-logo { color: var(--green); }
[data-theme="dark"] .modal-card h2 { color: #EAE8E3; }
[data-theme="dark"] .modal-card p { color: rgba(255,255,255,0.45); }
[data-theme="dark"] .modal-card .waitlist-form input { border-color: rgba(255,255,255,0.12); background: rgba(255,255,255,0.06); color: #EAE8E3; }
[data-theme="dark"] .modal-card .waitlist-form input::placeholder { color: rgba(255,255,255,0.3); }
[data-theme="dark"] .modal-card .waitlist-form input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(61,170,116,0.15); }
[data-theme="dark"] .modal-card .btn-p { background: var(--green); color: #fff; }
[data-theme="dark"] .modal-card .btn-p:hover { background: #34976a; }
[data-theme="dark"] .modal-card .waitlist-msg { color: rgba(255,255,255,0.5); }
[data-theme="dark"] .modal-card .waitlist-msg.success { color: #3DAA74; }
[data-theme="dark"] .modal-card .waitlist-msg.error { color: var(--amber-light); }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .modal-card { background: #1A1815; box-shadow: 0 24px 80px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.06); }
  :root:not([data-theme="light"]) .modal-close { background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.5); }
  :root:not([data-theme="light"]) .modal-close:hover { background: rgba(255,255,255,0.14); }
  :root:not([data-theme="light"]) .modal-logo { color: var(--green); }
  :root:not([data-theme="light"]) .modal-card h2 { color: #EAE8E3; }
  :root:not([data-theme="light"]) .modal-card p { color: rgba(255,255,255,0.45); }
  :root:not([data-theme="light"]) .modal-card .waitlist-form input { border-color: rgba(255,255,255,0.12); background: rgba(255,255,255,0.06); color: #EAE8E3; }
  :root:not([data-theme="light"]) .modal-card .waitlist-form input::placeholder { color: rgba(255,255,255,0.3); }
  :root:not([data-theme="light"]) .modal-card .waitlist-form input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(61,170,116,0.15); }
  :root:not([data-theme="light"]) .modal-card .btn-p { background: var(--green); color: #fff; }
  :root:not([data-theme="light"]) .modal-card .btn-p:hover { background: #34976a; }
  :root:not([data-theme="light"]) .modal-card .waitlist-msg { color: rgba(255,255,255,0.5); }
  :root:not([data-theme="light"]) .modal-card .waitlist-msg.success { color: #3DAA74; }
  :root:not([data-theme="light"]) .modal-card .waitlist-msg.error { color: var(--amber-light); }
}

@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; }
  .modal-card { padding: 48px 28px 40px; }
  .modal-card .waitlist-form { flex-direction: column; }
}
