/* Steve OS · Apple HIG-inspired Theme · Light default + Dark toggle
 * Reference: Apple Human Interface Guidelines (iOS 17 / macOS Sonoma)
 */

:root, [data-theme="light"] {
  /* Surfaces — Apple system grays */
  --bg: #ffffff;
  --bg-elevated: #fbfbfd;
  --surface: #ffffff;
  --surface-2: #f5f5f7;
  --surface-3: #e8e8ed;
  --surface-grouped: #f2f2f7;

  /* Borders — Apple uses very light separators */
  --border: rgba(0, 0, 0, 0.06);
  --border-strong: rgba(0, 0, 0, 0.12);
  --separator: rgba(60, 60, 67, 0.12);

  /* Text — Apple iOS label hierarchy */
  --text: #1d1d1f;
  --text-secondary: #424245;
  --text-tertiary: #6e6e73;
  --muted: #6e6e73;
  --dim: #86868b;

  /* Accents — Apple iOS 17 system colors (light) */
  --blue: #007aff;
  --indigo: #5856d6;
  --purple: #af52de;
  --pink: #ff2d55;
  --green: #34c759;
  --yellow: #ffcc00;
  --orange: #ff9500;
  --teal: #5ac8fa;
  --red: #ff3b30;
  --mint: #00c7be;
  --cyan: #32ade6;
  --brown: #a2845e;

  /* Brand */
  --whatsapp: #25D366;
  --telegram: #229ED9;

  /* Glass */
  --glass: rgba(255, 255, 255, 0.72);
  --glass-strong: rgba(255, 255, 255, 0.88);

  /* Shadows — Apple uses soft, layered */
  --shadow-xs: 0 1px 1px rgba(0,0,0,.02), 0 1px 2px rgba(0,0,0,.03);
  --shadow-sm: 0 2px 4px rgba(0,0,0,.04), 0 1px 2px rgba(0,0,0,.03);
  --shadow-md: 0 8px 24px rgba(0,0,0,.06), 0 2px 6px rgba(0,0,0,.04);
  --shadow-lg: 0 24px 64px rgba(0,0,0,.08), 0 8px 16px rgba(0,0,0,.04);
  --shadow-glow: 0 12px 40px rgba(0, 122, 255, 0.10);

  --logo-fill: #1d1d1f;
  --logo-text: #ffffff;
}

[data-theme="dark"] {
  --bg: #000000;
  --bg-elevated: #1c1c1e;
  --surface: #1c1c1e;
  --surface-2: #2c2c2e;
  --surface-3: #3a3a3c;
  --surface-grouped: #1c1c1e;

  --border: rgba(255, 255, 255, 0.06);
  --border-strong: rgba(255, 255, 255, 0.14);
  --separator: rgba(84, 84, 88, 0.65);

  --text: #f5f5f7;
  --text-secondary: #ebebf5;
  --text-tertiary: #ebebf5;
  --muted: #98989d;
  --dim: #6e6e73;

  --blue: #0a84ff;
  --indigo: #5e5ce6;
  --purple: #bf5af2;
  --pink: #ff375f;
  --green: #30d158;
  --yellow: #ffd60a;
  --orange: #ff9f0a;
  --teal: #64d2ff;
  --red: #ff453a;
  --mint: #66d4cf;
  --cyan: #64d2ff;
  --brown: #ac8e68;

  --whatsapp: #25D366;
  --telegram: #229ED9;

  --glass: rgba(28, 28, 30, 0.72);
  --glass-strong: rgba(28, 28, 30, 0.92);

  --shadow-xs: 0 1px 1px rgba(0,0,0,.4);
  --shadow-sm: 0 2px 4px rgba(0,0,0,.4), 0 1px 2px rgba(0,0,0,.3);
  --shadow-md: 0 8px 24px rgba(0,0,0,.5), 0 2px 6px rgba(0,0,0,.3);
  --shadow-lg: 0 24px 64px rgba(0,0,0,.6), 0 8px 16px rgba(0,0,0,.3);
  --shadow-glow: 0 12px 40px rgba(10, 132, 255, 0.18);

  --logo-fill: #f5f5f7;
  --logo-text: #000000;
}

* { box-sizing: border-box; }

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Inter', 'Helvetica Neue', system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.47;
  letter-spacing: -0.022em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'cv11', 'ss01', 'ss03', 'kern';
  margin: 0;
  transition: background-color .25s ease, color .25s ease;
}

.mono { font-family: 'JetBrains Mono', 'SF Mono', Menlo, Consolas, monospace; }

/* Apple iOS 17 type scale (px sizes calibrated for retina) */
.type-large-title  { font-size: 56px; line-height: 1.07; letter-spacing: -0.05em; font-weight: 700; }
.type-title-1      { font-size: 40px; line-height: 1.1;  letter-spacing: -0.04em; font-weight: 700; }
.type-title-2      { font-size: 32px; line-height: 1.13; letter-spacing: -0.03em; font-weight: 600; }
.type-title-3      { font-size: 22px; line-height: 1.18; letter-spacing: -0.022em; font-weight: 600; }
.type-headline     { font-size: 17px; line-height: 1.29; letter-spacing: -0.022em; font-weight: 600; }
.type-body         { font-size: 17px; line-height: 1.47; letter-spacing: -0.022em; font-weight: 400; }
.type-callout      { font-size: 16px; line-height: 1.31; letter-spacing: -0.018em; font-weight: 400; }
.type-subheadline  { font-size: 15px; line-height: 1.33; letter-spacing: -0.014em; font-weight: 400; }
.type-footnote     { font-size: 13px; line-height: 1.38; letter-spacing: -0.005em; font-weight: 400; }
.type-caption-1    { font-size: 12px; line-height: 1.33; letter-spacing: 0;        font-weight: 400; }
.type-caption-2    { font-size: 11px; line-height: 1.27; letter-spacing: 0.06em;   font-weight: 500; }

.display {
  font-weight: 700;
  letter-spacing: -0.05em;
  line-height: 1.05;
}

.gradient-text {
  background: linear-gradient(135deg, var(--blue) 0%, var(--indigo) 50%, var(--purple) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Steve OS lockup — monochrome Apple-style mark + wordmark */
.os-lockup {
  display: inline-flex;
  align-items: center;
  gap: 14px;
}
.os-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: var(--logo-fill);
  color: var(--logo-text);
  box-shadow: var(--shadow-sm);
}
.os-mark-sm {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--logo-fill);
  color: var(--logo-text);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-2);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.014em;
}

.surface {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow-xs);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-xs);
  transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}

.card-hero {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 22px 24px;
  box-shadow: var(--shadow-sm);
}

.card-icon {
  flex-shrink: 0;
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 10px;
}

.card-icon-lg { width: 52px; height: 52px; border-radius: 14px; }
.card-icon-sm { width: 28px; height: 28px; border-radius: 7px; }

.card-title {
  font-weight: 600;
  font-size: 15px;
  line-height: 1.27;
  letter-spacing: -0.018em;
  margin: 0;
  color: var(--text);
}

.card-sub {
  font-family: 'JetBrains Mono', 'SF Mono', monospace;
  font-size: 11px;
  color: var(--text-tertiary);
  line-height: 1.4;
  margin-top: 3px;
  letter-spacing: 0;
}

.card-meta {
  font-family: 'JetBrains Mono', 'SF Mono', monospace;
  font-size: 10px;
  line-height: 1.3;
  margin-top: 6px;
  letter-spacing: 0.06em;
  font-weight: 600;
  text-transform: uppercase;
}

.frame {
  border: 1px dashed currentColor;
  border-radius: 22px;
  padding: 32px 28px;
  position: relative;
}

.frame-label {
  position: absolute;
  top: -12px;
  left: 28px;
  background: var(--bg);
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.step-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 5px 12px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-tertiary);
  letter-spacing: -0.01em;
  box-shadow: var(--shadow-xs);
}

.step-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-weight: 600;
  color: var(--text-tertiary);
}

.arrow-line {
  width: 1.5px; height: 36px; margin: 0 auto;
  background: linear-gradient(180deg, currentColor 0%, currentColor 70%, transparent 100%);
  position: relative;
}

.arrow-line::after {
  content: ''; position: absolute; bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: 0; height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 6px solid currentColor;
}

nav.top {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  background: var(--glass);
  border-bottom: 1px solid var(--separator);
}

.container { max-width: 1100px; margin: 0 auto; padding: 0 22px; }
.container-tight { max-width: 880px; margin: 0 auto; padding: 0 22px; }
.container-wide { max-width: 1280px; margin: 0 auto; padding: 0 22px; }

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px; height: 30px;
  border-radius: 100px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  transition: all .2s ease;
}
.theme-toggle:hover { background: var(--surface-3); }

/* Apple-style buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: 980px;
  font-weight: 500;
  font-size: 15px;
  letter-spacing: -0.014em;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all .15s ease;
}
.btn-primary {
  background: var(--blue);
  color: white;
}
.btn-primary:hover { filter: brightness(0.95); }
.btn-secondary {
  background: var(--surface-2);
  color: var(--text);
  border-color: transparent;
}
.btn-secondary:hover { background: var(--surface-3); }

/* Powered-by lockup with logos */
.powered-by {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  border-radius: 100px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 500;
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  opacity: 0.85;
  transition: opacity .2s ease;
  box-shadow: var(--shadow-xs);
}
.powered-by:hover { opacity: 1; }

.powered-by .logo-juan,
.powered-by .logo-hive {
  height: 13px;
  width: auto;
  display: block;
}

[data-theme="light"] .powered-by .logo-juan-light { display: block; }
[data-theme="light"] .powered-by .logo-juan-dark { display: none; }
[data-theme="light"] .powered-by .logo-hive { filter: invert(1) hue-rotate(180deg); }

[data-theme="dark"] .powered-by .logo-juan-light { display: none; }
[data-theme="dark"] .powered-by .logo-juan-dark { display: block; }
[data-theme="dark"] .powered-by .logo-hive { filter: none; }

.powered-by .sep {
  width: 1px;
  height: 12px;
  background: var(--border-strong);
}

/* Subtle section dividers (Apple style) */
.divider {
  height: 1px;
  background: var(--separator);
  border: none;
  margin: 0;
}

/* Apple section spacing */
section.apple-section { padding: clamp(64px, 10vh, 120px) 0; }

/* Refined focus rings */
:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
  border-radius: 6px;
}

/* Better link hover */
a { transition: opacity .15s ease, color .15s ease; }
