/* ==========================================================================
   Shared design tokens
   Linked by both homepage.dc.html and app/index.html — anything used on
   more than one page belongs here, not duplicated per page.
   ========================================================================== */
:root {
  --accent:        rgb(249, 199, 0);
  --accent-hover:  #ffd633;
  --blue:          #5395FF;
  --pink:          #FD11D9;
  --text:          #f8f8f8;
  --hairline:      #ffffff1f;
}

/* ==========================================================================
   Shared keyframes
   Previously duplicated per page under prefixed names (spin/appSpin,
   pulseGlow/appPulseGlow, gridPan/appGridPan, noiseShift/appNoiseShift).
   ========================================================================== */
@keyframes grid-pan {
  from { background-position: 0 0; }
  to   { background-position: 48px 48px; }
}

@keyframes noise-shift {
  0%   { transform: translate(0,0); }
  10%  { transform: translate(-3%,-2%); }
  20%  { transform: translate(2%,3%); }
  30%  { transform: translate(-2%,2%); }
  40%  { transform: translate(3%,-3%); }
  50%  { transform: translate(-3%,1%); }
  60%  { transform: translate(1%,-2%); }
  70%  { transform: translate(2%,2%); }
  80%  { transform: translate(-1%,-3%); }
  90%  { transform: translate(3%,1%); }
  100% { transform: translate(0,0); }
}

/* ==========================================================================
   Shared noise-texture overlay
   Same fixed film-grain layer used on both pages; only stacking (z-index)
   differs, set per-page via a modifier class.
   ========================================================================== */
.noise-overlay {
  position: fixed;
  inset: -10%;
  pointer-events: none;
  mix-blend-mode: overlay;
  opacity: 0.5;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\' width=\'180\' height=\'180\'><filter id=\'n\'><feTurbulence type=\'fractalNoise\' baseFrequency=\'0.85\' numOctaves=\'3\' stitchTiles=\'stitch\'/><feColorMatrix type=\'saturate\' values=\'0\'/></filter><rect width=\'100%25\' height=\'100%25\' filter=\'url(%23n)\'/></svg>');
  background-size: 180px 180px;
  animation: noise-shift 0.6s steps(8) infinite;
}

/* ==========================================================================
   Shared brand lockup (site logo + name)
   Identical markup/styling on the homepage header and the app header.
   ========================================================================== */
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text);
}

.brand-icon {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
}

.brand-label {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 15px;
  letter-spacing: 0.04em;
  font-weight: 600;
}

/* ==========================================================================
   Shared site header + nav
   One definition for both the homepage and the app page — previously the
   app page carried its own app-header/app-nav/app-nav-dropdown rules that
   had drifted from the homepage's (different icon size, font sizes,
   padding, background opacity, box-shadow). Position/z-index are the only
   things that legitimately differ per page (the homepage header is sticky
   over a scrolling page; the app page header sits over a fixed-height,
   internally-scrolling layout) — set those with the page modifier classes
   below, not by duplicating the whole header.
   ========================================================================== */
.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px clamp(16px, 4vw, 32px);
  background: rgba(15,15,17,0.72);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid #ffffff17;
  transform: translateZ(0);
}

.site-header--sticky {
  position: sticky;
  top: 0;
  z-index: 20;
}

.site-header--static {
  position: relative;
  z-index: 30;
}

.site-nav {
  display: none;
  align-items: center;
  gap: clamp(14px, 3vw, 28px);
}

.nav-link {
  font-family: 'Lato', 'Century Gothic', sans-serif;
  color: #ffffffcc;
  font-size: 14px;
  font-weight: 400;
  text-decoration: none;
  transition: color 0.15s ease;
}

.nav-link:hover {
  color: var(--accent);
}

.mobile-nav {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 19;
  display: flex;
  flex-direction: column;
  padding: 8px clamp(16px, 4vw, 32px) 16px;
  background: rgba(9,9,11,1);
  backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid #ffffff17;
}

/* Never show the mobile dropdown once the desktop nav is showing —
   guards against it being left open across a resize, on either page. */
@media (min-width: 780px) {
  .mobile-nav { display: none !important; }
}

.mobile-nav-link {
  font-family: 'Lato', 'Century Gothic', sans-serif;
  padding: 12px 0;
  border-bottom: 1px solid #ffffff14;
  color: var(--text);
  font-size: 15px;
  text-decoration: none;
  transition: color 0.15s ease;
}

.mobile-nav-link:hover {
  color: var(--accent);
}

.mobile-nav-link:last-child { border-bottom: none; }

/* The app page toggles this dropdown via the native `hidden` attribute
   (see app/nav-toggle.js). Author CSS always beats the UA's built-in
   [hidden]{display:none}, so without this rule the dropdown would stay
   visible regardless of the attribute — this restores it. Harmless on
   the homepage, which mounts/unmounts the dropdown instead of hiding it. */
.mobile-nav[hidden] { display: none !important; }

/* ==========================================================================
   Shared feedback modal
   Both pages open the same modal from their "Feedback" link; the homepage
   drives it with dc-runtime state, the app page with plain JS
   (app/feedback-modal.js), but the markup/classes/behavior are identical.
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

/* Same [hidden] override as .mobile-nav above — the app page toggles
   this via the hidden attribute (app/feedback-modal.js); without this
   the modal would show immediately on page load and Cancel would
   appear to do nothing, since the attribute alone can't override the
   display:flex set above. */
.modal-overlay[hidden] { display: none !important; }

.modal-card {
  color: var(--text);
  font-family: 'Lato', 'Century Gothic', sans-serif;
  background: linear-gradient(160deg, rgba(32,32,34,0.92), rgba(18,18,20,0.92));
  backdrop-filter: blur(24px) saturate(160%);
  border: 1px solid #ffffff17;
  border-radius: 18px;
  padding: clamp(20px, 5vw, 32px);
  max-width: 440px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  transform: translateZ(0);
}

.modal-title {
  margin: 0 0 6px;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 19px;
  font-weight: 600;
}

.modal-desc {
  margin: 0 0 18px;
  font-size: 13px;
  color: #ffffff80;
  line-height: 1.5;
}

.modal-textarea {
  width: 100%;
  resize: vertical;
  background: rgba(255,255,255,0.06);
  border: 1px solid #ffffff26;
  border-radius: 10px;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  padding: 12px;
  box-sizing: border-box;
  outline: none;
}

.modal-label {
  display: block;
  margin: 12px 0 6px;
  font-size: 12px;
  color: #ffffff80;
}

.modal-input {
  width: 100%;
  background: rgba(255,255,255,0.06);
  border: 1px solid #ffffff26;
  border-radius: 10px;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  padding: 10px 12px;
  box-sizing: border-box;
  outline: none;
}

.modal-status {
  margin: 10px 0 0;
  font-size: 12px;
  min-height: 15px;
}

.modal-status--error { color: #ff8a8a; }
.modal-status--success { color: #8fdc9a; }

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
  justify-content: flex-end;
}

.modal-cancel {
  background: none;
  border: none;
  color: #ffffff99;
  font-size: 14px;
  cursor: pointer;
  padding: 10px 12px;
}

.modal-send {
  background: var(--accent);
  border: none;
  color: #0F0F0F;
  font-weight: 700;
  font-size: 14px;
  padding: 10px 20px;
  border-radius: 20px;
  cursor: pointer;
}

/* ==========================================================================
   Shared responsive nav toggle
   Both pages switch from a hamburger to an inline nav at the same
   breakpoint.
   ========================================================================== */
@media (min-width: 780px) {
  .nav-desktop   { display: flex !important; }
  .nav-hamburger { display: none !important; }
}

.nav-hamburger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 34px;
  height: 34px;
  background: rgba(255,255,255,0.06);
  border: 1px solid #ffffff26;
  border-radius: 9px;
  cursor: pointer;
  padding: 0;
}

.nav-hamburger-bar {
  display: block;
  width: 16px;
  height: 1.5px;
  background: var(--text);
  margin: 0 auto;
}
