/* Tolma Design System — Bold Courage (Apple Style) */

/* ========== DESIGN TOKENS ========== */

:root {
  /* Colors — Bold Courage (matched to TerminalColors.swift) */
  --color-bg: #F7F7F3;
  --color-bg-secondary: #F3F3EF;
  --color-surface: #F3F3EF;
  --color-surface-elevated: #E8E8E3;

  --color-text-primary: #151513;
  --color-text-secondary: #5E5E58;

  --color-accent: #147A50;
  --color-accent-subtle: #DCF0E4;
  --color-gold: #C4930D;
  --color-gold-subtle: #F2EBDA;

  --color-border: #D1D1CB;
  --color-divider: #C6C6BF;

  /* Typography — Barlow (matching app) */
  --font-primary: 'Barlow', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-data: 'Barlow Semi Condensed', var(--font-primary);

  --text-hero: clamp(48px, 6vw, 80px);
  --text-xl: clamp(32px, 4vw, 56px);
  --text-lg: 28px;
  --text-md: 21px;
  --text-sm: 17px;
  --text-xs: 14px;

  /* Spacing */
  --space-sm: 12px;
  --space-md: 24px;
  --space-lg: 40px;
  --space-xl: 80px;
  --space-xxl: 120px;

  /* UI */
  --radius-lg: 24px;
  --radius-xl: 32px;
  --shadow-soft: 0 10px 40px rgba(26, 26, 23, 0.06);
  --shadow-hover: 0 20px 60px rgba(26, 26, 23, 0.12);

  --nav-height: 60px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--color-bg);
  color: var(--color-text-primary);
  font-family: var(--font-primary);
  line-height: 1.4;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  opacity: 0;
  animation: fadeIn 0.5s ease 0.1s forwards;
}

@keyframes fadeIn {
  to { opacity: 1; }
}

::selection {
  background: var(--color-accent-subtle);
  color: var(--color-text-primary);
}

img {
  max-width: 100%;
  display: block;
}

/* Typography */
h1,
h2,
h3 {
  font-weight: 600;
  letter-spacing: -0.02em;
}

h1 {
  font-size: var(--text-hero);
  line-height: 1.05;
}

h2 {
  font-size: var(--text-xl);
  line-height: 1.1;
}

p {
  font-size: var(--text-md);
  color: var(--color-text-secondary);
  line-height: 1.5;
  font-weight: 400;
}

.section-label {
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--color-gold);
  margin-bottom: 16px;
  display: block;
}

/* Layout */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-md);
}

.section {
  padding: var(--space-xxl) 0;
}

/* Navigation */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: rgba(250, 250, 247, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 1000;
  display: flex;
  align-items: center;
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease;
}

.nav.scrolled {
  border-bottom-color: var(--color-divider);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--color-text-primary);
  text-decoration: none;
  font-size: 17px;
  letter-spacing: -0.01em;
}

.nav-logo-icon {
  border-radius: 6px;
}

/* Hamburger Menu */
.nav-hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 1001;
}

.nav-hamburger span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--color-text-primary);
  margin: 5px 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
  border-radius: 1px;
}

.nav-hamburger.active span:first-child {
  transform: rotate(45deg) translate(2.5px, 2.5px);
}

.nav-hamburger.active span:last-child {
  transform: rotate(-45deg) translate(2.5px, -2.5px);
}

.nav-links a {
  color: var(--color-text-secondary);
  text-decoration: none;
  font-size: 14px;
  margin-left: 24px;
  transition: color 0.2s;
}

.nav-links a:hover {
  color: var(--color-text-primary);
}

.btn {
  background: var(--color-text-primary);
  color: #fff;
  padding: 10px 20px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: transform 0.2s ease;
}

.btn:hover {
  transform: scale(1.02);
}

/* Hero */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding-top: 60px;
}

.hero h1 {
  margin-bottom: 24px;
}

.hero p {
  max-width: 600px;
  margin: 0 auto 40px;
}

.text-accent {
  color: var(--color-accent);
}

.hero-icon {
  width: 80px;
  height: 80px;
  border-radius: 18px;
  box-shadow: 0 8px 32px rgba(26, 26, 23, 0.12);
  margin-bottom: var(--space-md);
}

.hero-device {
  margin-top: 64px;
  display: flex;
  justify-content: center;
  transform-origin: center top;
}

.hero-device-frame {
  width: 280px;
  max-width: 70vw;
  background: var(--color-text-primary);
  border-radius: 40px;
  padding: 12px;
  box-shadow:
    0 24px 80px rgba(26, 26, 23, 0.2),
    0 8px 24px rgba(26, 26, 23, 0.1);
}

.hero-device-screen {
  width: 100%;
  height: auto;
  border-radius: 28px;
  display: block;
}

/* Bento Grid */
.bento-section {
  background: var(--color-bg);
}

.bento-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 24px;
}

.bento-card {
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  padding: 48px;
  box-shadow: var(--shadow-soft);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 400px;
  overflow: hidden;
  position: relative;
}

.bento-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.bento-card.wide {
  grid-column: 1 / -1;
  min-height: 500px;
  background: var(--color-text-primary);
  color: #F3F3EF;
}

.bento-card.wide p {
  color: #9A9A8F;
}

.bento-card h3 {
  font-size: 32px;
  margin-bottom: 12px;
}

.bento-header {
  margin-bottom: 60px;
}

.bento-card-content {
  position: relative;
  z-index: 1;
}

.bento-card-visual {
  width: 100%;
  height: 200px;
  border-radius: var(--radius-lg);
  margin-top: 32px;
}

/* Card 1: Precision Tracking */
.visual-precision {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-accent-subtle);
  position: relative;
}

.visual-weight-display {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-family: var(--font-data);
  position: relative;
}

.visual-weight-number {
  font-size: 64px;
  font-weight: 600;
  color: var(--color-text-primary);
  letter-spacing: -0.03em;
  line-height: 1;
}

.visual-weight-unit {
  font-size: 20px;
  font-weight: 500;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.visual-weight-badge {
  position: absolute;
  top: -8px;
  right: -40px;
  background: var(--color-gold);
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  letter-spacing: 0.1em;
}

/* Card 2: Offline First */
.visual-offline {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: var(--color-bg-secondary);
}

.visual-offline-icon {
  width: 64px;
  height: 64px;
  opacity: 0.8;
}

.visual-offline-label {
  font-family: var(--font-data);
  font-size: 14px;
  font-weight: 500;
  color: var(--color-accent);
  letter-spacing: 0.05em;
}

/* Card 3: Wide dark card with progress bars */
.bento-card.wide .section-label {
  color: var(--color-gold);
}

.visual-progress {
  background: transparent;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  height: 200px;
  margin-top: 0;
}

.visual-bars {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 160px;
  width: 100%;
  max-width: 300px;
}

.visual-bar {
  flex: 1;
  height: var(--bar-height);
  background: linear-gradient(to top, var(--color-accent), #2A9D6E);
  border-radius: 4px 4px 0 0;
  opacity: 0.9;
  transition: height 1s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Animate bars from zero when card scrolls into view */
.fade-up:not(.visible) .visual-bar {
  height: 0 !important;
}

/* Gallery Section */
.gallery-section {
  overflow: hidden;
}

.gallery-section .container {
  margin-bottom: 48px;
}

.gallery-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 0 var(--space-md);
}

.gallery-scroll::-webkit-scrollbar {
  display: none;
}

.gallery-track {
  display: flex;
  gap: 32px;
  padding: 0 max(var(--space-md), calc((100vw - 1200px) / 2));
  width: max-content;
}

.gallery-device {
  flex-shrink: 0;
  text-align: center;
}

.gallery-device-frame {
  width: 240px;
  background: var(--color-text-primary);
  border-radius: 36px;
  padding: 10px;
  box-shadow:
    0 20px 60px rgba(26, 26, 23, 0.15),
    0 8px 20px rgba(26, 26, 23, 0.08);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.gallery-device-frame:hover {
  transform: translateY(-8px);
}

.gallery-device-screen {
  width: 100%;
  height: auto;
  border-radius: 26px;
  display: block;
}

.gallery-caption {
  margin-top: 16px;
  font-size: 14px !important;
  font-weight: 500;
  color: var(--color-text-secondary) !important;
  letter-spacing: 0.02em;
}

/* CTA Section */
.cta-section {
  text-align: center;
}

.cta-section h2 {
  margin-bottom: 16px;
}

.cta-section p {
  max-width: 400px;
  margin: 0 auto 32px;
}

/* ========== ONE MORE THING ========== */

.omt-section {
  background: #151513;
  color: #F3F3EF;
  overflow: hidden;
}

.omt-spacer {
  height: 160px;
}

.omt-container {
  text-align: center;
  padding-bottom: var(--space-xxl);
}

.omt-phrase {
  font-size: var(--text-md);
  color: #9A9A8F;
  font-weight: 400;
  margin-bottom: 64px;
  letter-spacing: 0.01em;
}

.omt-feature {
  margin-bottom: 64px;
}

.omt-label {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: #C4930D;
  margin-bottom: 20px;
}

.omt-headline {
  font-size: clamp(32px, 5vw, 56px);
  color: #F3F3EF;
  line-height: 1.1;
  margin-bottom: 20px;
}

.omt-subline {
  font-size: var(--text-sm);
  color: #9A9A8F;
  max-width: 480px;
  margin: 0 auto;
  line-height: 1.5;
}

/* Macro visualization card */
.omt-visual {
  display: flex;
  justify-content: center;
}

.omt-card {
  display: flex;
  align-items: center;
  gap: 48px;
  background: #1E1E1B;
  border-radius: var(--radius-xl);
  padding: 48px;
  max-width: 560px;
  width: 100%;
}

.omt-ring-wrap {
  position: relative;
  width: 120px;
  height: 120px;
  flex-shrink: 0;
}

.omt-ring {
  width: 120px;
  height: 120px;
}

.omt-ring-progress {
  transition: stroke-dashoffset 1.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.omt-visual.visible .omt-ring-progress {
  stroke-dashoffset: 72; /* ~78% filled: 327 - (327 * 0.78) ≈ 72 */
}

.omt-ring-label {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  line-height: 1.2;
}

.omt-ring-number {
  display: block;
  font-family: var(--font-data);
  font-size: 22px;
  font-weight: 600;
  color: #F3F3EF;
}

.omt-ring-unit {
  display: block;
  font-size: 11px;
  color: #9A9A8F;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Macro bars */
.omt-macros {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.omt-macro-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
}

.omt-macro-name {
  font-size: 13px;
  color: #9A9A8F;
  font-weight: 500;
}

.omt-macro-value {
  font-size: 13px;
  font-family: var(--font-data);
  color: #F3F3EF;
  font-weight: 500;
}

.omt-macro-track {
  height: 6px;
  background: #2A2A27;
  border-radius: 3px;
  overflow: hidden;
}

.omt-macro-bar {
  height: 100%;
  width: 0;
  border-radius: 3px;
  transition: width 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.omt-visual.visible .omt-macro-bar {
  width: var(--bar-w);
}

.omt-macro-protein { background: #30B07A; }
.omt-macro-carbs { background: #C4930D; }
.omt-macro-fat { background: #7B8794; }

/* Staggered reveal */
.omt-reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.omt-reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.omt-feature.omt-reveal {
  transition-delay: 150ms;
}

.omt-visual.omt-reveal {
  transition-delay: 300ms;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .omt-reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .omt-ring-progress {
    stroke-dashoffset: 72;
    transition: none;
  }

  .omt-macro-bar {
    width: var(--bar-w);
    transition: none;
  }
}

/* Footer */
footer {
  padding: 80px 0 40px;
  border-top: 1px solid var(--color-divider);
  font-size: 13px;
  color: var(--color-text-secondary);
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.footer-brand {
  font-weight: 600;
  display: block;
  margin-bottom: 8px;
  color: var(--color-text-primary);
}

.footer-legal {
  font-size: 12px !important;
  max-width: 200px;
}

.footer-links {
  display: flex;
  gap: 24px;
}

.footer-links a {
  color: var(--color-text-secondary);
  text-decoration: none;
  font-size: 13px;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--color-text-primary);
}

/* Animations */
.fade-up {
  opacity: 0;
  transform: translateY(30px);
  transition: all 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ========== FORMS ========== */

.waitlist-form {
  margin-top: 32px;
  width: 100%;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

.form-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.waitlist-form input[type="email"],
.contact-form input[type="email"],
.contact-form input[type="text"],
.contact-form select,
.contact-form textarea {
  flex: 1;
  padding: 14px 20px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 999px;
  font-size: 16px;
  font-family: var(--font-primary);
  background: var(--color-surface);
  color: var(--color-text-primary);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.waitlist-form input[type="email"]:focus,
.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-subtle);
}

.contact-form textarea {
  border-radius: var(--radius-lg);
  resize: vertical;
  min-height: 120px;
}

.contact-form select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2386868B' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
}

.btn-accent {
  background: var(--color-accent);
  color: #fff;
  padding: 14px 28px;
  border-radius: 999px;
  border: none;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.2s ease, opacity 0.2s ease, box-shadow 0.2s ease;
  font-family: var(--font-primary);
}

.btn-accent:hover {
  transform: scale(1.02);
  box-shadow: 0 4px 16px rgba(27, 107, 74, 0.3);
}

.btn-accent:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-lg {
  padding: 16px 32px;
  font-size: 16px;
}

.form-status {
  font-size: 14px;
  margin-top: 12px;
  min-height: 20px;
  transition: opacity 0.3s ease;
}

.form-status.success {
  color: var(--color-accent);
}

.form-status.error {
  color: #D32F2F;
}

.form-note {
  font-size: 13px !important;
  color: var(--color-text-secondary) !important;
  margin-top: 8px;
}

/* Honeypot — invisible to humans */
.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.app-store-cta {
  margin-top: 32px;
}

/* ========== CONTACT FORM ========== */

.contact-form {
  max-width: 560px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.contact-form .form-row {
  flex-direction: column;
  gap: 16px;
}

.contact-form .form-row-inline {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ========== SUPPORT PAGE ========== */

.support-hero {
  min-height: auto;
  padding: calc(var(--nav-height) + var(--space-xl)) 0 var(--space-xl);
  text-align: center;
}

.support-hero h1 {
  font-size: var(--text-xl);
  margin-bottom: 16px;
}

.support-section {
  padding: 0 0 var(--space-xxl);
}

.support-alt {
  text-align: center;
  padding: var(--space-lg) 0 var(--space-xxl);
}

.support-alt a {
  color: var(--color-accent);
  text-decoration: none;
  font-weight: 500;
}

.support-alt a:hover {
  text-decoration: underline;
}

/* ========== RESPONSIVE ========== */

@media (max-width: 600px) {
  .nav-hamburger {
    display: block;
  }

  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background: var(--color-bg);
    flex-direction: column;
    padding: 80px 32px 32px;
    gap: 24px !important;
    transition: right 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: -8px 0 32px rgba(26, 26, 23, 0.1);
    z-index: 1000;
    display: flex;
  }

  .nav-links.open {
    right: 0;
  }

  .nav-links a {
    margin-left: 0;
    font-size: 18px;
    color: var(--color-text-primary);
  }

  .hero h1 {
    font-size: clamp(36px, 10vw, 48px);
  }

  .hero-device-frame {
    width: 240px;
    border-radius: 32px;
    padding: 8px;
  }

  .hero-device-screen {
    border-radius: 24px;
  }

  .form-row {
    flex-direction: column;
  }

  .waitlist-form input[type="email"] {
    width: 100%;
  }

  .btn-accent {
    width: 100%;
  }

  .bento-grid {
    grid-template-columns: 1fr;
  }

  .bento-card.wide {
    min-height: 400px;
  }

  .contact-form .form-row-inline {
    grid-template-columns: 1fr;
  }

  .gallery-device-frame {
    width: 200px;
    border-radius: 30px;
    padding: 8px;
  }

  .gallery-device-screen {
    border-radius: 22px;
  }

  .gallery-track {
    gap: 20px;
  }

  .footer-content {
    flex-direction: column;
    gap: 24px;
  }

  /* One More Thing — mobile */
  .omt-spacer {
    height: 80px;
  }

  .omt-card {
    flex-direction: column;
    gap: 32px;
    padding: 32px;
  }
}