/* ============================================
   OpenToad Design System — styles.css
   Brand: Forest #0d4a2c · Lime #c8f060
   Type: Space Grotesk (display) · DM Sans (body) · DM Mono (labels)
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Space+Grotesk:wght@500;600;700&family=DM+Sans:wght@300;400;500&display=swap');

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body { font-family: 'DM Sans', sans-serif; background: var(--surf); color: var(--ink); line-height: 1.6; overflow-x: hidden; }
a { text-decoration: none; color: inherit; }
img, svg { display: block; max-width: 100%; }
button { font-family: 'DM Sans', sans-serif; cursor: pointer; }

/* --- Color tokens --- */
:root {
  --forest:   #0d4a2c;
  --canopy:   #1a7a4a;
  --moss:     #2ea96a;
  --lime:     #c8f060;
  --dew:      #e8f5ee;
  --obsidian: #111410;
  --stone:    #4a4f45;
  --slate:    #8a8f85;
  --fog:      #f7f8f5;
  --pebble:   #d8ddd4;
  --white:    #ffffff;

  /* Aliases used throughout */
  --gd:   var(--forest);
  --g:    var(--canopy);
  --gm:   var(--moss);
  --gl:   var(--dew);
  --acc:  var(--lime);
  --ink:  var(--obsidian);
  --inkm: var(--stone);
  --inkf: var(--slate);
  --surf: var(--fog);
  --wht:  var(--white);
  --bdr:  var(--pebble);

  /* Semantic */
  --amber-light: #FAEEDA;
  --amber:       #854F0B;
  --amber-mid:   #EF9F27;
  --blue-light:  #E6F1FB;
  --blue:        #0C447C;
  --blue-mid:    #378ADD;
  --purple-light:#EEEDFE;
  --purple:      #3C3489;
  --red-light:   #FCEBEB;
  --red:         #A32D2D;

  /* Spacing */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-6: 24px;
  --sp-8: 32px;
  --sp-12: 48px;
  --sp-16: 64px;
  --sp-24: 96px;

  /* Radius */
  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-xl: 16px;

  /* Motion */
  --t-fast:   150ms ease-out;
  --t-mid:    250ms ease-out;
  --t-slow:   400ms ease-out;

  /* Container */
  --max-w: 1160px;
  --content-pad: 2.5rem;
}

/* --- Typography --- */
h1, h2, h3, h4, h5 { font-family: 'Space Grotesk', sans-serif; font-weight: 700; color: var(--ink); line-height: 1.1; letter-spacing: -0.02em; }
h1 { font-size: clamp(2.8rem, 6vw, 5.5rem); font-weight: 800; letter-spacing: -0.03em; }
h2 { font-size: clamp(1.8rem, 3.5vw, 2.8rem); }
h3 { font-size: 1.25rem; }
h4 { font-size: 1rem; }
p  { color: var(--inkm); line-height: 1.7; }
.mono { font-family: 'DM Mono', monospace; }
.label {
  font-family: 'DM Mono', monospace;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--moss);
}

/* --- Layout --- */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 var(--content-pad); }
.section    { padding: 6rem var(--content-pad); }
.grid-2     { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.25rem; }
.grid-3     { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.25rem; }
.grid-4     { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; }

/* --- Card --- */
.card {
  background: var(--wht);
  border: 0.5px solid var(--bdr);
  border-radius: var(--r-lg);
  padding: 1.25rem;
}

/* --- Buttons --- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 0.8rem 1.75rem;
  border-radius: var(--r-md);
  font-weight: 500; font-size: 0.95rem;
  border: none;
  transition: background var(--t-fast), transform var(--t-fast), opacity var(--t-fast);
}
.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn:disabled:hover { transform: none; }
.btn-primary   { background: var(--forest); color: var(--white); }
.btn-primary:hover { background: var(--canopy); }
.btn-accent    { background: var(--lime); color: var(--forest); }
.btn-accent:hover  { opacity: 0.88; }
.btn-outline   { background: var(--white); color: var(--inkm); border: 1px solid var(--bdr); }
.btn-outline:hover { border-color: var(--canopy); color: var(--canopy); }
.btn-sm { padding: 0.45rem 1rem; font-size: 0.82rem; border-radius: var(--r-sm); }

/* --- Pills / tags --- */
.pill {
  display: inline-block;
  font-family: 'DM Mono', monospace;
  font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.08em;
  padding: 3px 9px; border-radius: 10px; font-weight: 500;
}
.pill-green  { background: var(--dew);          color: var(--forest); }
.pill-amber  { background: var(--amber-light);   color: var(--amber); }
.pill-blue   { background: var(--blue-light);    color: var(--blue); }
.pill-purple { background: var(--purple-light);  color: var(--purple); }

/* --- Nav --- */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(247,248,245,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--bdr);
  padding: 0 var(--content-pad);
  display: flex; align-items: center; justify-content: space-between;
  height: 62px;
}
.nav-left {
  display: flex; align-items: center; gap: 2.5rem;
}
.nav-actions {
  display: flex; align-items: center; gap: 0.6rem; flex-shrink: 0;
}
@media (max-width: 400px) {
  .nav-actions { gap: 0.4rem; }
  .nav-actions .btn { padding-left: 0.7rem; padding-right: 0.7rem; }
}
.nav-logo {
  display: flex; align-items: center; gap: 10px;
  font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 1.1rem;
  color: var(--ink);
}
.nav-logo .pip {
  width: 32px; height: 32px;
  background: var(--forest); border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
}
.nav-links { display: flex; align-items: center; gap: 2rem; list-style: none; }
.nav-links a { font-size: 0.875rem; font-weight: 500; color: var(--inkm); transition: color var(--t-fast); }
.nav-links a:hover { color: var(--canopy); }
/* Buttons inside the nav (e.g. "Launch a project") must keep their own
   button color instead of inheriting the muted nav-link color above —
   .nav-links a otherwise wins on specificity and washes the text out. */
.nav-links a.btn-primary { color: var(--white); }
.nav-links a.btn-primary:hover { color: var(--white); }
.nav-links a.btn-accent { color: var(--forest); }
.nav-links a.btn-accent:hover { color: var(--forest); }

/* --- Notice boxes --- */
.notice {
  display: flex; align-items: flex-start; gap: 10px;
  border-radius: var(--r-md); padding: 0.75rem 1rem;
}
.notice i { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
.notice-txt { font-size: 0.78rem; line-height: 1.55; }
.notice-green  { background: var(--dew); }
.notice-green  i, .notice-green  .notice-txt { color: var(--forest); }
.notice-amber  { background: var(--amber-light); }
.notice-amber  i, .notice-amber  .notice-txt { color: var(--amber); }
.notice-blue   { background: var(--blue-light); }
.notice-blue   i, .notice-blue   .notice-txt { color: var(--blue); }

/* --- Progress bars --- */
.progress-wrap { height: 5px; background: var(--bdr); border-radius: 3px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 3px; background: var(--moss); transition: width var(--t-slow); }

/* --- Marquee --- */
.marquee-section { border-top: 1px solid var(--bdr); border-bottom: 1px solid var(--bdr); background: var(--wht); overflow: hidden; padding: 1rem 0; }
.marquee-track   { display: flex; gap: 3rem; align-items: center; animation: marquee 28s linear infinite; width: max-content; white-space: nowrap; }
.marquee-item    { font-family: 'DM Mono', monospace; font-size: 0.72rem; color: var(--slate); display: flex; align-items: center; gap: 8px; text-transform: uppercase; letter-spacing: 0.08em; }
.marquee-dot     { width: 4px; height: 4px; background: var(--moss); border-radius: 50%; flex-shrink: 0; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* --- Footer --- */
.footer { border-top: 1px solid var(--bdr); background: var(--fog); padding: 3rem var(--content-pad); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 2rem; }
.footer-bottom { border-top: 1px solid var(--bdr); background: var(--fog); padding: 1.25rem var(--content-pad); display: flex; justify-content: space-between; align-items: center; font-size: 0.78rem; color: var(--slate); flex-wrap: wrap; gap: 0.75rem; }
.footer-col h5 { font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink); margin-bottom: 0.85rem; }
.footer-col ul  { list-style: none; display: flex; flex-direction: column; gap: 0.5rem; }
.footer-col a   { font-size: 0.82rem; color: var(--slate); transition: color var(--t-fast); }
.footer-col a:hover { color: var(--canopy); }

/* --- Hero image carousel ---
   Two-column hero: copy on the left, an auto-cycling photo carousel on the
   right filling what used to be blank space. Crossfades between stacked
   <img> tags via the .active class, toggled from a small inline script on
   the homepage; falls back to a static first image if JS doesn't run. */
.hero-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: 3rem; align-items: center; position: relative; z-index: 1; }
.hero-carousel {
  position: relative; border-radius: var(--r-xl); overflow: hidden;
  aspect-ratio: 4 / 3; box-shadow: 0 24px 56px rgba(13,74,44,0.18);
  border: 1px solid var(--bdr); background: var(--fog);
}
.hero-carousel img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transition: opacity 900ms ease;
}
.hero-carousel img.active { opacity: 1; }
.hero-carousel::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to top, rgba(9,20,14,0.6) 0%, rgba(9,20,14,0) 38%);
}
.hero-carousel-caption {
  position: absolute; left: 18px; bottom: 40px; z-index: 2;
  color: #fff; font-family: 'DM Mono', monospace; font-size: 0.72rem;
  text-transform: uppercase; letter-spacing: 0.08em;
}
.hero-carousel-dots { position: absolute; left: 18px; bottom: 18px; z-index: 2; display: flex; gap: 6px; }
.hero-carousel-dot { width: 18px; height: 3px; border-radius: 2px; background: rgba(255,255,255,0.4); cursor: pointer; transition: background var(--t-fast); }
.hero-carousel-dot.active { background: var(--lime); }
.hero-carousel-toggle {
  position: absolute; right: 18px; bottom: 14px; z-index: 2;
  width: 32px; height: 32px; border-radius: 50%; padding: 0;
  background: rgba(9,20,14,0.45); border: 1px solid rgba(255,255,255,0.35);
  color: #fff; display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background var(--t-fast);
}
.hero-carousel-toggle:hover { background: rgba(9,20,14,0.7); }
.hero-carousel-toggle svg { width: 13px; height: 13px; }
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 2rem; }
  .hero-carousel { aspect-ratio: 16 / 10; }
}

/* --- Mobile bottom tab bar ---
   Hidden on desktop; replaces the top nav-links as the primary navigation on
   phone-width screens (that list is hidden below, and .mobile-tabbar takes
   over instead). Deliberately scoped to Home / Projects / Explore / Launch —
   the same four destinations this would carry over as bottom tabs if/when
   OpenToad becomes a native app, so this set is already validated by then. */
.mobile-tabbar {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
  background: rgba(247,248,245,0.96);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--bdr);
  padding: 8px 0 max(8px, env(safe-area-inset-bottom));
  align-items: center; justify-content: space-around;
}
.tab-item {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  color: var(--slate); font-size: 0.62rem; font-weight: 600;
  flex: 1;
}
.tab-item svg { width: 22px; height: 22px; }
.tab-item.active { color: var(--forest); }

/* --- Responsive --- */
@media (max-width: 768px) {
  :root { --content-pad: 1.25rem; }
  .nav-links { display: none; }
  .section { padding: 4rem var(--content-pad); }
  h1 { font-size: 2.4rem; }
  body { padding-bottom: 64px; }
  .mobile-tabbar { display: flex; }
}
