/* ===== Flow State Racing — styles ===== */
:root {
  --navy: #0b1f3a;
  --navy-2: #12294b;
  --ink: #1a2433;
  --muted: #5b6b80;
  --line: #e3e8ef;
  --bg-alt: #f5f7fa;
  --white: #ffffff;
  --accent: #19b5c8;       /* ocean teal accent */
  --accent-dark: #1199aa;
  --radius: 10px;
  --shadow: 0 10px 30px rgba(11, 31, 58, 0.08);
  --max: 1160px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body { margin: 0; font-family: var(--font); color: var(--ink); line-height: 1.65; background: var(--white); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { line-height: 1.15; margin: 0 0 0.5em; color: var(--navy); }
h2 { font-size: clamp(2rem, 4vw, 2.75rem); font-weight: 800; letter-spacing: -0.02em; }
h3 { font-size: 1.2rem; font-weight: 700; }
p { margin: 0 0 1em; }

.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 24px; }

.placeholder { color: #a05a00; background: #fff6e5; border-radius: 4px; padding: 0 4px; font-style: italic; }
.section-dark .placeholder { color: #ffd08a; background: rgba(255, 208, 138, 0.1); }

/* ---- Buttons ---- */
.btn { display: inline-block; padding: 14px 30px; border-radius: 999px; font-weight: 600; font-size: 0.95rem; letter-spacing: 0.06em; text-transform: uppercase; transition: all 0.2s ease; border: 2px solid transparent; cursor: pointer; font-family: inherit; }
.btn-primary { background: var(--accent); color: var(--white); }
.btn-primary:hover { background: var(--accent-dark); transform: translateY(-1px); }
.btn-ghost { border-color: rgba(255,255,255,0.7); color: var(--white); }
.btn-ghost:hover { background: rgba(255,255,255,0.12); }
.btn-block { width: 100%; }

/* ---- Header / Nav ---- */
.site-header { position: fixed; inset: 0 0 auto 0; z-index: 100; transition: background 0.3s, box-shadow 0.3s; }
.site-header.scrolled { background: rgba(11, 31, 58, 0.96); box-shadow: 0 2px 20px rgba(0,0,0,0.15); backdrop-filter: blur(8px); }
.nav { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.logo { font-weight: 800; letter-spacing: 0.14em; font-size: 1rem; color: var(--white); display: inline-block; padding: 12px 0; line-height: 20px; }
.logo span { color: var(--accent); }
.nav-links { list-style: none; display: flex; gap: 36px; margin: 0; padding: 0; align-items: center; }
.nav-links a { color: var(--white); font-size: 0.85rem; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; opacity: 0.9; transition: opacity 0.2s, color 0.2s; }
.nav-links a:hover, .nav-links a.active { opacity: 1; color: var(--accent); }
.nav-links .nav-cta { border: 1.5px solid var(--accent); padding: 8px 18px; border-radius: 999px; }
.nav-links .nav-cta:hover { background: var(--accent); color: var(--white); }
.nav-toggle { display: none; background: none; border: 0; width: 44px; height: 44px; cursor: pointer; padding: 10px; margin-right: -6px; }
.nav-toggle span { display: block; height: 2px; background: var(--white); margin: 5px 0; transition: transform 0.3s, opacity 0.3s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---- Hero ---- */
.hero {
  position: relative; min-height: 100vh; display: flex; align-items: center; color: var(--white);
  background:
    url("images/hero.jpg") 100% 85% / 130% auto no-repeat,
    linear-gradient(135deg, #0b1f3a 0%, #134a73 55%, #19b5c8 100%);
}
.hero-overlay { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(11,31,58,0.15) 0%, rgba(11,31,58,0.35) 45%, rgba(11,31,58,0.75) 100%), linear-gradient(180deg, rgba(11,31,58,0.45) 0%, rgba(11,31,58,0) 30%, rgba(11,31,58,0.5) 100%); }
.hero-content > * { max-width: 560px; margin-left: auto; }
.hero-actions { justify-content: flex-start; }
.hero-content { position: relative; z-index: 1; padding-top: 72px; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.25em; font-size: 0.78rem; font-weight: 600; color: var(--accent); margin-bottom: 1.2em; }
.hero h1 { color: var(--white); font-size: clamp(3rem, 9vw, 6.5rem); font-weight: 800; letter-spacing: 0.02em; line-height: 0.95; margin-bottom: 0.3em; }

.hero h1 .h1-name {
  display: block;
  font-size: clamp(1rem, 2.4vw, 1.35rem);
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.55em;
  line-height: 1.2;
}
.hero h1 .h1-brand { display: block; }

.hero .eyebrow { margin-top: 0.4em; margin-bottom: 2.4em; }
.tagline { font-size: clamp(1rem, 2vw, 1.35rem); letter-spacing: 0.35em; font-weight: 500; margin-bottom: 2.2em; opacity: 0.95; }
.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; }
.scroll-cue { position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); color: var(--white); font-size: 1.4rem; opacity: 0.7; animation: bob 2s infinite; display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; }
@keyframes bob { 0%,100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, 8px); } }

/* ---- Sections ---- */
.section { padding: 110px 0; }
.section-alt { background: var(--bg-alt); }
.section-dark { background: var(--navy); color: #d6deea; }
.section-dark h2, .section-dark h3 { color: var(--white); }
.section-label { text-transform: uppercase; letter-spacing: 0.25em; font-size: 0.75rem; font-weight: 700; color: var(--accent); margin-bottom: 0.8em; }
.section-intro { color: var(--muted); max-width: 640px; margin-bottom: 2.5em; display: inline-block; }
.sub-heading { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.18em; color: var(--muted); margin: 2em 0 0.9em; }

/* ---- About ---- */
.about-grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: 72px; align-items: center; }
.image-placeholder { aspect-ratio: 4 / 5; border-radius: var(--radius); background: linear-gradient(160deg, #dfe7f1, #c4d3e4); display: flex; align-items: center; justify-content: center; text-align: center; padding: 24px; color: #a05a00; font-style: italic; font-weight: 500; border: 2px dashed #9fb3c9; }
.about-photo { display: block; width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 50%; border-radius: var(--radius); background: #f4f5f7; box-shadow: var(--shadow); }
.lead { font-size: 1.15rem; }
.about-text p { color: var(--muted); }
.about-text p.placeholder { display: inline-block; }
.tag-list { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.tag-list li { padding: 8px 16px; border-radius: 999px; background: var(--navy); color: var(--white); font-size: 0.85rem; font-weight: 500; }
.tag-list--muted li { background: transparent; color: var(--navy); border: 1.5px solid var(--line); }

/* ---- Results ---- */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; margin-bottom: 48px; }
.stat-card { background: var(--white); border-radius: var(--radius); padding: 32px 24px; box-shadow: var(--shadow); border-top: 3px solid var(--accent); display: flex; flex-direction: column; gap: 6px; }
.stat-number { font-size: 2.6rem; font-weight: 800; color: var(--navy); line-height: 1; }
.stat-label { font-size: 0.85rem; color: var(--muted); }
.table-wrap { overflow-x: auto; background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); }
.results-table { width: 100%; border-collapse: collapse; min-width: 560px; }
.results-table th, .results-table td { padding: 18px 24px; text-align: left; border-bottom: 1px solid var(--line); }
.results-table th { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.15em; color: var(--muted); font-weight: 700; cursor: pointer; user-select: none; white-space: nowrap; background: #fbfcfd; }
.results-table th:hover { color: var(--navy); }
.results-table tbody tr:hover { background: #f8fafc; }
.results-table tbody tr:last-child td { border-bottom: 0; }
.results-table td:first-child { font-weight: 700; color: var(--navy); }
.sort-icon::after { content: "↕"; opacity: 0.35; margin-left: 4px; }
th[aria-sort="ascending"] .sort-icon::after { content: "↑"; opacity: 1; color: var(--accent); }
th[aria-sort="descending"] .sort-icon::after { content: "↓"; opacity: 1; color: var(--accent); }
.table-note { font-size: 0.85rem; color: var(--muted); margin-top: 14px; }

/* ---- Services ---- */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; margin-top: 48px; }
.card { padding: 40px 32px; border: 1px solid var(--line); border-radius: var(--radius); transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s; background: var(--white); }
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: transparent; }
.card-icon { width: 54px; height: 54px; border-radius: 12px; background: rgba(25,181,200,0.12); display: flex; align-items: center; justify-content: center; margin-bottom: 24px; }
.card-icon svg { width: 28px; height: 28px; fill: var(--accent-dark); }
.card p { color: var(--muted); }
.card-detail { font-size: 0.88rem; display: inline-block; }

/* ---- Contact ---- */
.contact-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: 72px; align-items: start; }
.contact-meta { list-style: none; padding: 0; margin: 2em 0 0; }
.contact-meta li { padding: 14px 0; border-top: 1px solid rgba(255,255,255,0.1); display: flex; gap: 16px; flex-wrap: wrap; }
.contact-meta strong { color: var(--white); min-width: 90px; font-weight: 600; }
.contact-form { background: var(--white); color: var(--ink); padding: 40px; border-radius: var(--radius); box-shadow: 0 20px 50px rgba(0,0,0,0.25); position: relative; }
.form-row { margin-bottom: 20px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
label { display: block; font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--navy); margin-bottom: 8px; }
.optional { text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--muted); }
input, select, textarea { width: 100%; padding: 13px 14px; border: 1.5px solid var(--line); border-radius: 8px; font: inherit; font-size: 0.95rem; color: var(--ink); background: #fbfcfd; transition: border-color 0.2s, box-shadow 0.2s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(25,181,200,0.18); background: var(--white); }
.invalid { border-color: #d64545 !important; }
textarea { resize: vertical; }
.form-error { color: #d64545; font-size: 0.9rem; margin: 0 0 14px; }
.form-success { text-align: center; padding: 20px 0 0; }
.form-success h3 { color: var(--navy); }
.form-success p { color: var(--muted); }

/* ---- Footer ---- */
.site-footer { background: #071528; color: #8fa0b8; padding: 48px 0; }
.footer-inner { display: flex; flex-direction: column; align-items: center; gap: 20px; text-align: center; }
.social { list-style: none; padding: 0; margin: 0; display: flex; gap: 28px; flex-wrap: wrap; justify-content: center; }
.social a { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.15em; transition: color 0.2s; }
.social a:hover { color: var(--accent); }
.copyright { font-size: 0.8rem; margin: 0; }
.site-footer .placeholder { color: #ffd08a; background: rgba(255,208,138,0.08); }

/* ---- Gallery ---- */
.gallery-grid { display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: 220px; gap: 14px; margin-top: 1.5em; }
.gallery-item { position: relative; padding: 0; border: 0; margin: 0; overflow: hidden; border-radius: var(--radius); background: var(--bg-alt); cursor: zoom-in; box-shadow: var(--shadow); }
.gallery-item img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s ease; }
.gallery-item::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(11,31,58,0) 60%, rgba(11,31,58,0.25) 100%); opacity: 0; transition: opacity 0.3s; }
.gallery-item:hover img { transform: scale(1.04); }
.gallery-item:hover::after, .gallery-item:focus-visible::after { opacity: 1; }
.gallery-item:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.g-feature { grid-column: span 2; grid-row: span 2; }
.g-tall { grid-row: span 2; }
.lightbox { position: fixed; inset: 0; z-index: 200; background: rgba(6, 16, 32, 0.94); display: flex; align-items: center; justify-content: center; padding: 56px 72px; }
.lightbox[hidden] { display: none; }
.lb-img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; box-shadow: 0 20px 60px rgba(0,0,0,0.5); }
.lb-btn { position: absolute; background: rgba(255,255,255,0.08); color: var(--white); border: 1px solid rgba(255,255,255,0.2); width: 48px; height: 48px; border-radius: 50%; font-size: 1.8rem; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background 0.2s; }
.lb-btn:hover, .lb-btn:focus-visible { background: var(--accent); outline: none; }
.lb-close { top: 16px; right: 16px; }
.lb-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 16px; top: 50%; transform: translateY(-50%); }
.lb-count { position: absolute; bottom: 14px; left: 0; right: 0; text-align: center; color: rgba(255,255,255,0.7); font-size: 0.8rem; letter-spacing: 0.15em; margin: 0; pointer-events: none; }
body.lb-open { overflow: hidden; }
@media (max-width: 960px) {
  .gallery-grid { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 200px; }
}
@media (max-width: 760px) {
  .gallery-grid { grid-auto-rows: 132px; gap: 10px; }
  .lightbox { padding: 64px 12px; }
  .lb-prev, .lb-next { top: auto; bottom: 12px; transform: none; }
  .lb-prev { left: 12px; } .lb-next { right: 12px; }
  .lb-count { bottom: 26px; }
}

/* ---- Reveal animation ---- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.visible { opacity: 1; transform: none; }

/* ---- Responsive ---- */
@media (max-width: 960px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .cards { grid-template-columns: 1fr; max-width: 560px; }
  .about-grid, .contact-grid { grid-template-columns: 1fr; gap: 48px; }
  .about-image { max-width: 420px; }
}
@media (max-width: 760px) {
  .section { padding: 56px 0; }
  .hero { align-items: flex-end; padding-bottom: 90px; background-position: 47% center, center; background-size: cover, cover; }
  .hero-overlay { background: linear-gradient(180deg, rgba(11,31,58,0.35) 0%, rgba(11,31,58,0.3) 35%, rgba(11,31,58,0.88) 100%); }
  .hero-content > * { margin-left: 0; }
  .hero-content { text-shadow: 0 2px 16px rgba(0,0,0,0.35); }
  .nav-toggle { display: block; }
  .nav-links { position: fixed; top: 72px; left: 0; right: 0; flex-direction: column; gap: 0; background: var(--navy); padding: 12px 24px 28px; transform: translateY(-120%); opacity: 0; visibility: hidden; transition: transform 0.3s, opacity 0.3s, visibility 0.3s; box-shadow: 0 10px 30px rgba(0,0,0,0.25); }
  .nav-links.open { transform: none; opacity: 1; visibility: visible; }
  .nav-links li { width: 100%; }
  .nav-links a { display: block; padding: 16px 0; border-bottom: 1px solid rgba(255,255,255,0.08); }
  .nav-links .nav-cta { border: 0; padding: 16px 0; border-radius: 0; }
  .site-header.menu-open { background: var(--navy); }
  .two-col { grid-template-columns: 1fr; }
  .contact-form { padding: 28px 22px; }
  .tagline { letter-spacing: 0.25em; }
}
@media (max-width: 420px) {
  .stats { gap: 12px; }
  .stat-card { padding: 22px 16px; }
  .stat-number { font-size: 2rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .scroll-cue { animation: none; }
}

/* Instagram link */
.ig-link { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; color: var(--accent); font-weight: 600; transition: opacity 0.2s; }
.ig-link:hover { opacity: 0.8; }
.ig-icon { flex-shrink: 0; }
.social a.ig-link { font-size: 0.95rem; text-transform: none; letter-spacing: 0.03em; }

/* ===== Mobile refinements ===== */
@media (max-width: 760px) {
  /* Hero eyebrow: one phrase per line */
  .hero .eyebrow .eb-item { display: block; }
  .hero .eyebrow .eb-item + .eb-item { margin-top: 0.35em; }
  .hero .eyebrow .eb-sep { display: none; }

  /* Contact meta rows: center the taller Instagram link */
  .contact-meta li { align-items: center; padding: 6px 0; min-height: 52px; }

  /* Results: compact cards instead of a wide table */
  .table-wrap { overflow: visible; background: transparent; box-shadow: none; border-radius: 0; }
  .results-table, .results-table thead, .results-table tbody { display: block; width: 100%; min-width: 0; }
  .results-table thead tr { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
  .results-table th { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border: 1.5px solid var(--line); border-radius: 999px; background: var(--white); letter-spacing: 0.1em; }
  .results-table th[aria-sort] { border-color: var(--accent); color: var(--navy); }
  .results-table tbody tr { display: flex; flex-wrap: wrap; align-items: baseline; background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px 16px; margin-bottom: 8px; }
  .results-table tbody tr:hover { background: var(--white); }
  .results-table tbody tr:last-child { margin-bottom: 0; }
  .results-table td { display: block; padding: 0; border: 0; line-height: 1.45; }
  .results-table td:nth-child(1) { order: 1; font-size: 0.82rem; font-weight: 700; color: var(--muted); }
  .results-table td:nth-child(3) { order: 2; font-size: 0.82rem; font-weight: 600; color: var(--muted); }
  .results-table td:nth-child(3)::before { content: "\00a0·\00a0"; }
  .results-table td:nth-child(2) { order: 3; flex: 0 0 100%; font-weight: 700; color: var(--navy); margin: 3px 0 4px; }
  .results-table td:nth-child(4) { order: 4; font-size: 0.92rem; font-weight: 700; color: var(--accent-dark); }
  .results-table td:nth-child(5) { order: 5; font-size: 0.92rem; color: var(--ink); }
  .results-table td:nth-child(5)::before { content: "\00a0of\00a0"; }
  .results-table td:nth-child(6) { order: 6; font-size: 0.92rem; color: var(--ink); }
  .results-table td:nth-child(6)::before { content: "\00a0·\00a0"; color: var(--muted); }
}

/* Results: show first 15 rows on computers, 6 cards on phones */
.results-more { display: block; margin-top: 24px; text-align: center; }
.results-more-btn { min-height: 48px; min-width: 220px; padding: 12px 28px; }
.results-table.is-collapsed tbody tr:nth-child(n+16) { display: none; }
@media (max-width: 760px) {
  .results-more { margin-top: 16px; }
  .results-table.is-collapsed tbody tr:nth-child(n+7) { display: none; }
}

/* Results: regatta names link to official results */
.regatta-link { color: inherit; text-decoration: none; border-bottom: 1px solid transparent; transition: color .15s, border-color .15s; }
.regatta-link::after { content: "\2197"; display: inline-block; margin-left: .3em; font-size: .8em; opacity: .45; transition: opacity .15s, transform .15s; }
.regatta-link:hover, .regatta-link:focus-visible { color: var(--accent-dark); border-bottom-color: currentColor; }
.regatta-link:hover::after, .regatta-link:focus-visible::after { opacity: 1; transform: translate(1px,-1px); }
.regatta-link:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; border-radius: 2px; }
@media (max-width: 760px) {
  .regatta-link { display: inline-block; min-height: 44px; padding: 10px 0; line-height: 1.35; }
}

/* Press */
.press-list { list-style: none; padding: 0; margin: 40px 0 0; display: grid; grid-template-columns: 1fr; gap: 16px; max-width: 880px; }
.press-list.is-collapsed .press-item:nth-child(n+6) { display: none; }
.press-item { display: flex; }
.press-card { display: flex; flex-direction: column; gap: 8px; width: 100%; padding: 26px 28px; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); color: inherit; text-decoration: none; transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s; }
.press-card:hover, .press-card:focus-visible { transform: translateY(-3px); box-shadow: var(--shadow); border-color: transparent; }
.press-card:focus-visible { outline: 2px solid var(--accent-dark); outline-offset: 2px; }
.press-meta { font-size: 0.78rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.press-outlet { color: var(--accent-dark); }
.press-title { font-size: 1.1rem; font-weight: 700; line-height: 1.35; color: var(--navy); }
.press-title::after { content: "\2197"; display: inline-block; margin-left: .35em; font-size: .8em; opacity: .45; transition: opacity .15s, transform .15s; }
.press-card:hover .press-title::after, .press-card:focus-visible .press-title::after { opacity: 1; transform: translate(1px,-1px); }
.press-blurb { font-size: 0.95rem; color: var(--muted); line-height: 1.5; }
.press-more { margin-top: 28px; text-align: center; max-width: 880px; }
.press-more-btn { min-height: 48px; min-width: 200px; }
@media (max-width: 760px) {
  .press-list { grid-template-columns: 1fr; gap: 14px; margin-top: 28px; }
  .press-card { padding: 20px 20px; }
  .press-title { font-size: 1.02rem; }
}

/* Phones: Press shows 3 most recent when collapsed */
@media (max-width: 760px) {
  .press-list.is-collapsed .press-item:nth-child(n+4) { display: none; }
}

/* Back-to-top floating button */
.to-top { position: fixed; z-index: 900; right: calc(20px + env(safe-area-inset-right, 0px)); bottom: calc(20px + env(safe-area-inset-bottom, 0px)); width: 48px; height: 48px; border-radius: 50%; border: 2px solid rgba(255,255,255,0.9); background: var(--accent-dark); color: var(--white); display: flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 6px 18px rgba(11,31,58,0.28); opacity: 0; visibility: hidden; transform: translateY(10px); transition: opacity 0.25s, transform 0.25s, visibility 0.25s, background 0.2s; -webkit-tap-highlight-color: transparent; }
.to-top.is-visible { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { background: var(--navy); }
.to-top:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.to-top svg { width: 22px; height: 22px; }
@media (max-width: 760px) {
  .to-top { right: calc(16px + env(safe-area-inset-right, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }
  .site-footer { padding-bottom: 88px; } /* keep copyright clear of the back-to-top button */
}
@media (prefers-reduced-motion: reduce) {
  .to-top { transition: opacity 0.01s, visibility 0.01s; transform: none; }
}
