/* Shared look for the home page (ovals) and every topic page.
   The old link list (links.html) keeps its own styles inside the file. */

/* ============ COLORS (change the look here, and in the dark mode copy below) ============ */
:root {
  --bg: #f7f3ec;          /* page background, warm paper */
  --surface: #fffdf9;     /* oval and card background */
  --ink: #1c2433;         /* main text */
  --muted: #5b6474;       /* secondary text */
  --line: #e6dfd3;        /* borders */
  --accent: #c2410c;      /* burnt orange: links, highlights */
  --accent-soft: #fde9dc;
  --deep: #16324f;        /* hero panel, deep blue */
  --deep-ink: #f4efe6;
  --glow: #f59e0b;
  --radius: 18px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1621; --surface: #161f2d; --ink: #ece6da; --muted: #a3acba;
    --line: #263244; --accent: #fb923c; --accent-soft: #3a2415;
    --deep: #0b2238; --deep-ink: #f4efe6; --glow: #fbbf24;
  }
}

* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 17px/1.6 Inter, system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }

/* ============ HERO (top panel) ============ */
.hero {
  position: relative; overflow: hidden; color: var(--deep-ink);
  background: var(--deep); padding: 28px 0 120px;
}
.hero::before, .hero::after {
  content: ""; position: absolute; border-radius: 50%; filter: blur(60px); opacity: .45;
}
.hero::before { width: 520px; height: 520px; right: -140px; top: -180px; background: var(--glow); }
.hero::after  { width: 420px; height: 420px; left: -160px; bottom: -220px; background: #2f7a8a; }
.hero > .wrap { position: relative; z-index: 1; }
.brand { display: inline-flex; align-items: center; gap: 12px; font-weight: 600; letter-spacing: .02em; }
.brand svg { width: 36px; height: 36px; }
.hero h1 {
  font-family: Fraunces, Georgia, serif; font-weight: 650;
  font-size: clamp(2.6rem, 7vw, 4.6rem); line-height: 1.02; letter-spacing: -.02em;
  margin: 64px 0 18px; max-width: 14ch;
}
.hero h1 em { font-style: italic; color: var(--glow); font-weight: 500; }
.hero p.lede { font-size: 1.2rem; max-width: 46ch; opacity: .88; margin: 0; }

/* ============ OVALS (home page) ============ */
.ovals {
  list-style: none; margin: -72px 0 0; padding: 0; position: relative; z-index: 2;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 22px 26px;
}
.ovals li { width: 236px; }
.ovals li:nth-child(even) { margin-top: 30px; }   /* gentle up and down stagger */
.oval {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  aspect-ratio: 16 / 10; width: 100%; padding: 12px 22px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--line); text-align: center;
  box-shadow: 0 18px 40px -26px rgba(16,24,40,.45);
  transition: transform .2s, border-color .2s, box-shadow .2s;
}
.oval:hover, .oval:focus-visible {
  transform: translateY(-4px); border-color: var(--accent);
  box-shadow: 0 26px 50px -24px rgba(16,24,40,.5);
}
.oval:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
.oval strong { font-family: Fraunces, Georgia, serif; font-weight: 650; font-size: 1.35rem; line-height: 1.15; }
.oval small { display: block; margin-top: 4px; color: var(--muted); font-size: .85rem; line-height: 1.3; }

/* ============ TOPIC PAGES ============ */
.topbar { background: var(--deep); color: var(--deep-ink); padding: 18px 0; }
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.topbar .back { font-size: .95rem; font-weight: 500; opacity: .85; }
.topbar .back:hover { opacity: 1; }
.page-head { padding: 56px 0 8px; }
.page-head .tag {
  display: inline-block; font-size: .75rem; font-weight: 600; letter-spacing: .08em;
  text-transform: uppercase; color: var(--accent); background: var(--accent-soft);
  padding: 4px 10px; border-radius: 999px;
}
.page-head h1 {
  font-family: Fraunces, Georgia, serif; font-weight: 650; letter-spacing: -.02em;
  font-size: clamp(2.2rem, 6vw, 3.6rem); line-height: 1.05; margin: 14px 0 0;
  hyphens: auto; overflow-wrap: anywhere;   /* long titles like "Photobiomodulation" fit on phones */
}
.content { max-width: 70ch; padding-top: 20px; }
.content h2 { font-family: Fraunces, Georgia, serif; font-weight: 650; font-size: 1.7rem; margin: 40px 0 12px; }
.content a:not(.card) { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.content .cards + .table-wrap { margin-top: 20px; }
.content .note { color: var(--muted); font-size: .9rem; }

/* Screenshot gallery (CTS page) */
.shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.shots figure { margin: 0; }
.shots img {
  display: block; width: 100%; height: auto; border-radius: 12px;
  border: 1px solid var(--line); box-shadow: 0 14px 30px -22px rgba(16,24,40,.5);
}
.shots figcaption { margin-top: 6px; font-size: .9rem; color: var(--muted); }
.content .cards + h2 { margin-top: 44px; }

/* Study tables (Thioguard page) */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.studies { width: 100%; border-collapse: collapse; font-size: .92rem; line-height: 1.45; }
.studies th, .studies td { text-align: left; vertical-align: top; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.studies tr:last-child td { border-bottom: 0; }
.studies th { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.studies td:first-child { font-weight: 600; color: var(--accent); white-space: nowrap; }
.studies td:nth-child(2) { font-weight: 500; min-width: 11em; }
@media (max-width: 560px) {   /* phones: stack each study instead of a wide table */
  .studies thead { display: none; }
  .studies tr { display: block; padding: 12px 14px; border-bottom: 1px solid var(--line); }
  .studies tr:last-child { border-bottom: 0; }
  .studies td { display: block; padding: 2px 0; border: 0; min-width: 0 !important; }
}

.soon {
  border: 2px dashed var(--line); border-radius: var(--radius); padding: 32px;
  color: var(--muted); text-align: center;
}

/* Link cards, same look as the old link list, for adding links to a topic page */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; max-width: none; }
.card {
  display: flex; gap: 14px; align-items: flex-start;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  padding: 18px; transition: border-color .2s, transform .2s;
}
.card:hover { border-color: var(--accent); transform: translateY(-2px); }
.card .ico {
  flex: none; width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent);
}
.card .ico svg { width: 22px; height: 22px; }
.card h3 { margin: 0 0 2px; font-size: 1.02rem; font-weight: 600; }
.card p { margin: 0; color: var(--muted); font-size: .92rem; line-height: 1.45; }
.card .host { display: block; margin-top: 6px; font-size: .78rem; color: var(--accent); font-weight: 500; }

/* ============ FOOTER ============ */
footer { margin-top: 96px; border-top: 1px solid var(--line); padding: 32px 0 48px; color: var(--muted); font-size: .9rem; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 12px 32px; justify-content: space-between; }
footer a { text-decoration: underline; text-underline-offset: 3px; }

@media (max-width: 560px) {
  body { font-size: 16px; }
  .wrap { padding: 0 16px; }
  .hero h1 { margin-top: 44px; }
  .ovals { gap: 14px 12px; }
  .ovals li { width: calc(50% - 6px); }
  .ovals li:nth-child(even) { margin-top: 18px; }
  .oval { aspect-ratio: 4 / 3; padding: 8px 12px; }
  .oval strong { font-size: 1.05rem; hyphens: auto; overflow-wrap: anywhere; }
  .oval small { font-size: .75rem; }
  .page-head { padding-top: 40px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
