/* ============================================================
   gelo.fyi — Design System (light mode only)
   Apple × OpenAI: editorial monochrome, hairline borders,
   frosted chrome, pill buttons, one quiet blue.
   ============================================================ */

*,
*::before,
*::after { box-sizing: border-box; }

* { margin: 0; }

:root {
  color-scheme: light;

  /* Surfaces */
  --bg: #fbfbfd;
  --bg-elevated: #ffffff;
  --bg-subtle: #f5f5f7;

  /* Type */
  --text: #1d1d1f;
  --text-secondary: #6e6e73;
  --text-tertiary: #86868b;

  /* Lines */
  --border: rgba(0, 0, 0, 0.08);
  --border-strong: rgba(0, 0, 0, 0.16);

  /* One quiet accent (Apple blue) */
  --accent: #0071e3;
  --accent-soft: rgba(0, 113, 227, 0.12);
  --accent-hover: #0077ed;

  /* Buttons — OpenAI-style monochrome pills */
  --btn-bg: #1d1d1f;
  --btn-bg-hover: #000000;
  --btn-text: #ffffff;

  --danger: #d70015;
  --success: #1d8a4e;

  --nav-bg: rgba(251, 251, 253, 0.72);

  /* Elevation — only where something rests on a surface */
  --shadow-tile: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-tile-hover: 0 16px 40px rgba(0, 0, 0, 0.10), 0 2px 8px rgba(0, 0, 0, 0.05);
  --shadow-pop: 0 24px 64px rgba(0, 0, 0, 0.16);

  /* Icon tiles — iOS-style squircle gradient */
  --grad-warm: linear-gradient(135deg, #ff9f0a, #ff375f);

  /* Radii */
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-xl: 28px;

  --nav-h: 52px;
  --container: 1120px;

  /* Motion — Apple springs */
  --ease: cubic-bezier(0.25, 0.1, 0.25, 1);
  --ease-spring: cubic-bezier(0.32, 0.72, 0, 1);
}

/* ---------- Base ---------- */

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
    "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 17px;
  line-height: 1.5;
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }

img, svg { display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
input { font: inherit; }

::selection { background: color-mix(in srgb, var(--accent) 24%, transparent); }

/* the outline follows the element's own border-radius (pills stay pills) */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.container {
  width: min(var(--container), 100% - 48px);
  margin-inline: auto;
}

@media (max-width: 560px) {
  .container { width: calc(100% - 40px); }
}

/* ---------- Nav (frosted "liquid glass") ---------- */

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

.nav-inner {
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.02em;
  border-radius: 8px;
}

.brand-mark { color: var(--text); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-links a {
  font-size: 13.5px;
  color: var(--text-secondary);
  transition: color 0.25s var(--ease);
  border-radius: 6px;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] { color: var(--text); }

@media (max-width: 480px) {
  .nav-links { gap: 18px; }
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border-radius: 980px;
  font-weight: 500;
  letter-spacing: -0.01em;
  white-space: nowrap;
  user-select: none;
  transition:
    transform 0.3s var(--ease-spring),
    background-color 0.3s var(--ease),
    box-shadow 0.3s var(--ease),
    opacity 0.3s var(--ease);
}

.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--btn-bg);
  color: var(--btn-text);
}

.btn-primary:hover { background: var(--btn-bg-hover); }

.btn-md { height: 44px; padding: 0 22px; font-size: 15px; }
.btn-lg { height: 54px; padding: 0 30px; font-size: 17px; }

.btn:disabled {
  opacity: 0.35;
  cursor: default;
  transform: none;
}

.btn-ghost { color: var(--accent); }
.btn-ghost:hover { color: var(--accent-hover); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Icon squircle (iOS-style app icon) ---------- */

.icon-squircle {
  width: 56px;
  height: 56px;
  flex: none;
  border-radius: 15px;
  display: grid;
  place-items: center;
  color: #ffffff;
  background: var(--grad-warm);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

/* ---------- Footer ---------- */

.footer {
  border-top: 1px solid var(--border);
  margin-top: 110px;
  padding: 30px 0 44px;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 24px;
  color: var(--text-tertiary);
  font-size: 12.5px;
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 500;
  color: var(--text-secondary);
}

.footer-brand svg { color: var(--text-tertiary); }

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

.footer-links a {
  transition: color 0.25s var(--ease);
  border-radius: 4px;
}

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

/* ---------- Motion primitives ---------- */

.reveal { opacity: 0; }
.reveal.is-visible { animation: reveal 0.8s var(--ease-spring) both; }

@keyframes reveal {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: none; }
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1; }
}

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 30px;
  z-index: 100;
  transform: translate(-50%, 16px);
  max-width: min(560px, calc(100vw - 40px));
  background: var(--btn-bg);
  color: var(--btn-text);
  font-size: 14px;
  line-height: 1.4;
  text-align: center;
  padding: 12px 22px;
  border-radius: 980px;
  box-shadow: var(--shadow-pop);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s var(--ease), transform 0.35s var(--ease-spring);
}

.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Utility ---------- */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
