/* ==================================================================
 * Shared styles for every page: brand colours, fonts, navbar,
 * page layout, cards, segmented buttons.
 * Feature-specific styles go in their own file (e.g. lens-thickness.css).
 * ================================================================== */

:root {
  --navy: #141b47;
  --navy-hover: #232c66;
  --bg: #ddf0f1;
  --teal: #62bfc1;
  --card: #ffffff;
  --nav-bg: rgba(244, 251, 251, 0.86);
  --text: #141b47;
  --muted: #6b7486;
  --line: #e3e6ea;
  --radius-lg: 22px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --shadow: 0 10px 30px rgba(20, 27, 71, 0.08);
  --font-head: 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-body: 'Lato', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

button { font: inherit; color: inherit; }

/* ---------------- Floating navbar ---------------- */

.navbar {
  position: sticky;
  top: 12px;
  z-index: 50;
  margin: 12px 24px 0;
  padding: 14px 22px 14px 36px;
  display: flex;
  align-items: center;
  gap: 40px;
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 36px;
  box-shadow: 0 12px 28px rgba(20, 27, 71, 0.12);
}

.brand img { display: block; height: 30px; width: auto; }

.nav-pill {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 9px;
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  overflow-x: auto;
}

.nav-tab {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 17px;
  color: var(--navy);
  text-decoration: none;
  padding: 10px 26px;
  border-radius: 999px;
  white-space: nowrap;
}
.nav-tab.is-active { background: var(--navy); color: #fff; }
.nav-tab:not(.is-active):hover { background: #eef4f6; }

.icon-btn {
  width: 48px; height: 48px;
  display: grid; place-items: center;
  border: 0; background: transparent; cursor: pointer;
  border-radius: 12px;
}
.icon-btn:hover { background: rgba(20, 27, 71, 0.06); }
.icon-btn svg {
  width: 30px; height: 30px;
  fill: none; stroke: var(--navy); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round;
}
.icon-btn .icon-exit { display: none; }
.is-fullscreen .icon-btn .icon-enter { display: none; }
.is-fullscreen .icon-btn .icon-exit { display: block; }

/* ---------------- Page ---------------- */

.page {
  max-width: 1360px;
  margin: 0 auto;
  padding: 36px 48px 48px;
}

.intro h1 {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(28px, 3vw, 40px);
  margin: 8px 0 6px;
  letter-spacing: -0.01em;
}
.intro p { margin: 0 0 28px; font-size: 17px; }

.card {
  background: var(--card);
  border-radius: var(--radius-lg);
}

/* ---------------- Segmented toggles ---------------- */

.seg {
  display: flex;
  padding: 8px;
  gap: 6px;
}

.seg-btn {
  flex: 1;
  border: 0;
  background: transparent;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 18px;
  color: var(--navy);
  padding: 14px 16px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.seg-btn:hover:not(.is-active) { background: #f0f5f7; }
.seg-btn.is-active { background: var(--navy); color: #fff; }

.seg-btn:focus-visible, .nav-tab:focus-visible, .icon-btn:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 2px;
}

/* ---------------- Full screen ---------------- */

:fullscreen body, body:fullscreen { overflow: auto; }

/* ---------------- Fit-to-screen pages ----------------
 * Add class="fit-screen" to <body> for a page that should fill the window
 * with no page scroll on desktop (tested at 1920×1080 and 1366×768).
 * Its <main class="page"> becomes a flex column that takes the remaining height;
 * the page's own CSS decides which part stretches.
 * Small / narrow screens keep normal scrolling.
 */
@media (min-width: 1200px) and (min-height: 560px) {
  body.fit-screen {
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
  }
  body.fit-screen .navbar { flex-shrink: 0; }
  body.fit-screen .page {
    flex: 1;
    min-height: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    padding-top: 24px;
    padding-bottom: 24px;
  }
}

/* Shorter desktop screens (e.g. 1366×768): slimmer navbar */
@media (min-width: 1200px) and (max-height: 820px) {
  .navbar { padding-top: 9px; padding-bottom: 9px; }
  .nav-pill { padding: 6px; }
  .nav-tab { padding: 8px 24px; font-size: 16px; }
  .icon-btn { width: 42px; height: 42px; }
  body.fit-screen .page { padding-top: 16px; padding-bottom: 16px; }
}

/* ---------------- Responsive ---------------- */

@media (max-width: 1100px) {
  .seg-btn { font-size: 16px; padding: 12px 10px; }
}

@media (max-width: 900px) {
  .navbar { margin: 10px 12px 0; padding: 10px 12px 10px 18px; gap: 14px; }
  .brand img { height: 20px; }
  .nav-pill { gap: 6px; padding: 6px; }
  .nav-tab { font-size: 14px; padding: 8px 14px; }
  .icon-btn { width: 40px; height: 40px; }
  .page { padding: 24px 16px 40px; }
}
