/* Capo Beach Consulting — site styles
   Layout: the hero is the logo's horizon (deep sky, sun sinking into the waterline,
   tapered foam strokes); below it, a quiet single column with a left-weighted split. */

@font-face {
  font-family: "Anton";
  src: url("fonts/anton-latin-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Public Sans";
  src: url("fonts/public-sans-latin-wght.woff2") format("woff2-variations"),
       url("fonts/public-sans-latin-wght.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Brand, sampled from the logo; the same in both themes */
  --sky-deep: #004E70;
  --sky-mid: #007DAE;
  --surf: #00ABE1;
  --sun: #FF9738;
  --foam: #FFFFFF;

  /* Opening animation: the risen sun's glow, the birds, and the sky it starts from */
  --sun-glow: rgba(255, 151, 56, 0.42);
  --bird: #082333;
  --dawn-from: #D6E5EC;
  --dawn-to: #DCF1F9;

  /* Page */
  --bg: #FFFFFF;
  --bg-alt: #F0F6F9;
  --ink: #0F2F3E;
  --ink-soft: #4A6574;
  --link: #005A7F;
  --rule: #D2E3EA;
  --focus: #005A7F;

  /* Apps band */
  --band: #063247;
  --band-ink: #E6F3F8;
  --band-soft: #B3CFDA;
  --band-head: #5CCFF5;
  --band-rule: #1F4E63;

  --font-display: "Anton", "Impact", "Haettenschweiler", "Arial Narrow Bold", sans-serif;
  --font-body: "Public Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --sun-size: clamp(150px, 26vw, 340px);
  --sun-ring: clamp(7px, 0.9vw, 12px);
  --sun-peak: -12%;
  --horizon: clamp(6px, 0.8vw, 10px);
  --measure: 38rem;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #06202C;
    --bg-alt: #0A2A39;
    --ink: #E3EFF4;
    --ink-soft: #A3BCC7;
    --link: #6FD3F5;
    --rule: #1C4253;
    --focus: #6FD3F5;
    --band: #03151E;
    --band-rule: #1A3E4F;
    --dawn-from: #020D14;
    --dawn-to: #03202E;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #06202C;
  --bg-alt: #0A2A39;
  --ink: #E3EFF4;
  --ink-soft: #A3BCC7;
  --link: #6FD3F5;
  --rule: #1C4253;
  --focus: #6FD3F5;
  --band: #03151E;
  --band-rule: #1A3E4F;
  --dawn-from: #020D14;
  --dawn-to: #03202E;
  color-scheme: dark;
}

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

html { -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 2px; }

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
}
.skip:focus {
  left: max(16px, env(safe-area-inset-left, 0px));
  top: 0.75rem;
  z-index: 20;
  background: var(--foam);
  color: var(--sky-deep);
  padding: 0.5rem 0.875rem;
  font-weight: 700;
}

.wrap {
  max-width: 72rem;
  margin-inline: auto;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
}

/* ---------- Sky: header, hero, page heads ---------- */

.sky-band {
  position: relative;
  isolation: isolate;
  background: linear-gradient(90deg, var(--sky-deep) 0%, var(--sky-mid) 100%);
  color: var(--foam);
  --focus: var(--sun);
}

.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
  padding-block: 1.25rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}
.brand img { width: 48px; height: 48px; }
.brand-name { display: flex; flex-direction: column; line-height: 1; }
.brand-word {
  font-family: var(--font-display);
  font-size: 1.625rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.brand-word .capo { color: var(--surf); }
.brand-word .beach { color: var(--sun); }
.brand-sub {
  margin-top: 0.3rem;
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--foam);
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-nav a {
  display: inline-block;
  color: var(--foam);
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  padding-block: 0.25rem;
  border-bottom: 2px solid transparent;
}
.site-nav a:hover { border-bottom-color: var(--sun); }

.hero { position: relative; overflow: hidden; }
.hero-inner {
  position: relative;
  z-index: 1;
  padding-top: clamp(2.5rem, 7vw, 5.5rem);
  padding-bottom: calc(var(--sun-size) * 0.56 + 2.5rem);
  pointer-events: none; /* let clicks through to the sun; the copy below re-enables them */
}
.hero-inner > * { pointer-events: auto; }
.hero h1 {
  margin: 0;
  max-width: 19ch;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.9rem, 8vw, 5.75rem);
  line-height: 0.98;
  letter-spacing: 0.005em;
  text-wrap: balance;
}
.lede {
  margin: 1.5rem 0 0;
  max-width: 36rem;
  font-size: clamp(1.0625rem, 1.6vw, 1.25rem);
  line-height: 1.55;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.75rem;
  margin-top: 2rem;
}
.btn {
  display: inline-block;
  padding: 0.8rem 1.4rem;
  border-radius: 999px;
  background: var(--foam);
  color: var(--sky-deep);
  font-weight: 700;
  text-decoration: none;
}
.btn:hover { box-shadow: 0 0 0 3px var(--sun); }
.hero-link { color: var(--foam); font-weight: 600; text-underline-offset: 0.25em; }

.sun {
  position: absolute;
  right: clamp(1rem, 9vw, 9rem);
  bottom: 0;
  width: var(--sun-size);
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--sun);
  box-shadow: 0 0 0 var(--sun-ring) var(--foam), 0 0 0 0 transparent;
  transform: translateY(46%);
  -webkit-tap-highlight-color: transparent;
}

.water {
  background: var(--surf);
  border-top: var(--horizon) solid var(--foam);
}
.water svg { display: block; width: 100%; height: clamp(52px, 8vw, 104px); }
.water--thin svg { height: clamp(26px, 4vw, 44px); }

/* The home page's horizon is drawn by a pseudo-element so it can sweep in */
.water--hero { border-top: 0; }
.water--hero::before {
  content: "";
  display: block;
  height: var(--horizon);
  background: var(--foam);
  transform-origin: left center;
}
.water--hero path { transform-box: fill-box; transform-origin: center; }

/* Birds: hidden unless the opening animation runs */
.gull-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.flock {
  position: absolute;
  inset: 0;
  display: none;
  color: var(--bird);
  font-size: clamp(12px, 1.5vw, 22px);
  pointer-events: none;
}
.gull { position: absolute; display: block; height: auto; aspect-ratio: 24 / 10; overflow: visible; transform-origin: 50% 60%; }
.gull:nth-child(1)  { left: 0;      top: 4.4em; width: 1.2em; }
.gull:nth-child(2)  { left: 1.6em;  top: 3.2em; width: 1em; }
.gull:nth-child(3)  { left: 3em;    top: 4.9em; width: 1.3em; }
.gull:nth-child(4)  { left: 4.4em;  top: 2.5em; width: 0.95em; }
.gull:nth-child(5)  { left: 5.7em;  top: 4em;   width: 1.15em; }
.gull:nth-child(6)  { left: 7em;    top: 1.6em; width: 1.05em; }
.gull:nth-child(7)  { left: 8.5em;  top: 3.1em; width: 1.4em; }
.gull:nth-child(8)  { left: 9.9em;  top: 0.9em; width: 0.95em; }
.gull:nth-child(9)  { left: 11.2em; top: 2.4em; width: 1.15em; }
.gull:nth-child(10) { left: 12.7em; top: 0.2em; width: 1em; }
.gull:nth-child(11) { left: 14.1em; top: 1.9em; width: 1.2em; }
.gull:nth-child(12) { left: 7.6em;  top: 5.8em; width: 0.9em; }

/* On phones the sun sits under the buttons, so it rises less far */
@media (max-width: 560px) {
  :root { --sun-peak: 22%; }
}

/* Opening sequence on the home page, about 6.5 seconds:
   the sky deepens, the horizon draws in, the copy arrives, whitecaps appear,
   birds cross while the sun rises with a soft glow, then it dips and
   settles where it rests. With reduced motion, the page simply appears at rest. */
@media (prefers-reduced-motion: no-preference) {
  .home .sky-band::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(90deg, var(--dawn-from), var(--dawn-to));
    animation: dawn 1.1s ease-out both;
    pointer-events: none;
  }
  .home .site-header .wrap { animation: appear 0.6s ease-out 0.45s both; }
  .home .hero-inner > * { animation: rise-in 0.75s cubic-bezier(0.2, 0.7, 0.3, 1) both; }
  .home .hero-inner > :nth-child(1) { animation-delay: 0.6s; }
  .home .hero-inner > :nth-child(2) { animation-delay: 0.78s; }
  .home .hero-inner > :nth-child(3) { animation-delay: 0.95s; }

  .home .water--hero::before { animation: draw-horizon 0.9s cubic-bezier(0.6, 0, 0.2, 1) 0.2s both; }
  .home .water--hero path { animation: whitecap 0.9s cubic-bezier(0.2, 0.7, 0.3, 1) both; }
  .home .water--hero path:nth-child(1) { animation-delay: 0.9s; }
  .home .water--hero path:nth-child(2) { animation-delay: 1.15s; }
  .home .water--hero path:nth-child(3) { animation-delay: 1s; }
  .home .water--hero path:nth-child(4) { animation-delay: 1.3s; }
  .home .water--hero path:nth-child(5) { animation-delay: 1.1s; }
  .home .water--hero path:nth-child(6) { animation-delay: 1.4s; }
  .home .water--hero path:nth-child(7) { animation-delay: 1.25s; }

  .home .sun { animation: sun-cycle 5.2s linear 1.35s both; }
  /* After the opening, a click or tap bounces the sun (site.js adds these classes) */
  .home .sun.is-ready { animation: none; cursor: pointer; }
  .home .sun.is-ready.is-bouncing { animation: sun-bounce 1.15s linear both; }

  .home .flock { display: block; animation: flight 4.8s linear 1.7s both; }
  .home .gull { animation: flap 0.42s ease-in-out 1.7s 24 alternate both; }
  .home .gull:nth-child(3n)   { animation-duration: 0.38s; animation-delay: 1.8s; }
  .home .gull:nth-child(3n+1) { animation-duration: 0.47s; animation-delay: 1.75s; }
}

@keyframes dawn { from { opacity: 1; } to { opacity: 0; } }
@keyframes appear { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise-in {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
@keyframes draw-horizon { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes whitecap {
  from { opacity: 0; transform: scaleX(0.05); }
  to { opacity: 1; transform: scaleX(1); }
}
@keyframes sun-cycle {
  0% {
    transform: translateY(112%);
    box-shadow: 0 0 0 var(--sun-ring) var(--foam), 0 0 64px 16px var(--sun-glow);
    animation-timing-function: cubic-bezier(0.25, 0.7, 0.35, 1);
  }
  42% {
    transform: translateY(var(--sun-peak));
    box-shadow: 0 0 0 var(--sun-ring) var(--foam), 0 0 64px 16px var(--sun-glow);
  }
  52% {
    transform: translateY(var(--sun-peak));
    box-shadow: 0 0 0 var(--sun-ring) var(--foam), 0 0 64px 16px var(--sun-glow);
    animation-timing-function: cubic-bezier(0.55, 0, 0.8, 0.3);
  }
  70% {
    transform: translateY(78%);
    box-shadow: 0 0 0 var(--sun-ring) var(--foam), 0 0 0 0 transparent;
    animation-timing-function: cubic-bezier(0.16, 0.84, 0.3, 1);
  }
  100% {
    transform: translateY(46%);
    box-shadow: 0 0 0 var(--sun-ring) var(--foam), 0 0 0 0 transparent;
  }
}
/* The flock starts just off the left edge, passes under the copy,
   crosses the face of the risen sun, and climbs out past the top right */
@keyframes flight {
  0%   { transform: translate(-17em, 76%); }
  20%  { transform: translate(21%, 70%); }
  40%  { transform: translate(64%, 55%); }
  70%  { transform: translate(92%, 20%); }
  100% { transform: translate(115%, -24%); }
}
/* Phones: the copy fills the width, so the flock skims the water past the sun */
@keyframes flight-low {
  0%   { transform: translate(-17em, 86%); }
  30%  { transform: translate(22%, 84%); }
  55%  { transform: translate(58%, 76%); }
  100% { transform: translate(115%, 52%); }
}
@media (max-width: 560px) and (prefers-reduced-motion: no-preference) {
  .home .flock { animation-name: flight-low; }
}
@keyframes flap {
  from { transform: scaleY(1); }
  to { transform: scaleY(-0.55); }
}
/* Hop up with a flash of glow, drop into the water, bob, and settle */
@keyframes sun-bounce {
  0% {
    transform: translateY(46%);
    box-shadow: 0 0 0 var(--sun-ring) var(--foam), 0 0 0 0 transparent;
    animation-timing-function: cubic-bezier(0.2, 0.7, 0.3, 1);
  }
  28% {
    transform: translateY(12%);
    box-shadow: 0 0 0 var(--sun-ring) var(--foam), 0 0 48px 12px var(--sun-glow);
    animation-timing-function: cubic-bezier(0.6, 0, 0.85, 0.4);
  }
  52% {
    transform: translateY(60%);
    animation-timing-function: cubic-bezier(0.2, 0.7, 0.3, 1);
  }
  72% {
    transform: translateY(40%);
    animation-timing-function: ease-in-out;
  }
  86% { transform: translateY(49%); animation-timing-function: ease-in-out; }
  100% {
    transform: translateY(46%);
    box-shadow: 0 0 0 var(--sun-ring) var(--foam), 0 0 0 0 transparent;
  }
}

.page-head .wrap { padding-block: clamp(2rem, 5vw, 3.5rem); }
.page-head h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.5rem, 6vw, 4rem);
  line-height: 1;
  letter-spacing: 0.005em;
}
.page-head p { margin: 0.75rem 0 0; }

/* ---------- Sections ---------- */

.section { padding-block: clamp(3.5rem, 8vw, 6.5rem); }
.section-alt { background: var(--bg-alt); }

h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.25rem, 4.4vw, 3.25rem);
  line-height: 1.02;
  letter-spacing: 0.005em;
  text-wrap: balance;
}
h3 { margin: 0; font-size: 1.1875rem; line-height: 1.3; font-weight: 700; }

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.55fr);
  gap: 2.5rem clamp(2.5rem, 6vw, 6rem);
  align-items: start;
}
.split--even { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.split > * { min-width: 0; }

.split-intro p { margin: 1.25rem 0 0; max-width: 32rem; color: var(--ink-soft); }

.service, .focus { border-top: 1px solid var(--rule); padding-block: 1.5rem; }
.service:first-child, .focus:first-child { padding-top: 0.25rem; border-top: 0; }
.service p, .focus p { margin: 0.5rem 0 0; max-width: var(--measure); color: var(--ink-soft); }

/* Selected work: a ledger whose columns line up with the split above */
.section-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.55fr);
  gap: 1rem clamp(2.5rem, 6vw, 6rem);
  align-items: end;
  margin-bottom: 2.5rem;
}
.section-head p { margin: 0; max-width: var(--measure); color: var(--ink-soft); }

.ledger { list-style: none; margin: 0; padding: 0; }
.entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.55fr);
  gap: 0.75rem clamp(2.5rem, 6vw, 6rem);
  border-top: 1px solid var(--rule);
  padding-block: 1.75rem;
}
.entry > * { min-width: 0; }
.entry-client { margin: 0; font-weight: 700; }
.entry-platform { margin: 0.15rem 0 0; font-size: 0.9375rem; color: var(--ink-soft); }
.entry-body p { margin: 0.5rem 0 0; max-width: var(--measure); color: var(--ink-soft); }

/* Apps band */
.band { background: var(--band); color: var(--band-ink); --focus: var(--sun); --rule: var(--band-rule); }
.band .split-intro p,
.band .focus p { color: var(--band-soft); }
.band h3 { color: var(--band-head); }
.band .split-intro .status {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-top: 1.75rem;
  color: var(--band-ink);
  font-weight: 600;
}
.status-dot {
  flex: none;
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 50%;
  background: var(--sun);
  box-shadow: 0 0 0 3px var(--band), 0 0 0 5px var(--foam);
}
.principles { border-top: 1px solid var(--rule); padding-top: 1.5rem; }
.principles ul { margin: 0.75rem 0 0; padding-left: 1.1rem; color: var(--band-soft); }
.principles li + li { margin-top: 0.35rem; }

/* About and contact */
.about p { margin: 1.25rem 0 0; max-width: var(--measure); color: var(--ink-soft); }
.contact p { margin: 1.25rem 0 0; color: var(--ink-soft); }
.contact .email {
  margin-top: 1rem;
  font-size: clamp(1.15rem, 2.6vw, 1.6rem);
  font-weight: 700;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

/* ---------- Legal pages ---------- */

.prose { max-width: 44rem; padding-block: clamp(2.5rem, 6vw, 4rem) clamp(3rem, 7vw, 5rem); }
.prose h2 {
  margin: 2.25rem 0 0;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1.3125rem;
  line-height: 1.3;
}
.prose h3 { margin: 1.5rem 0 0; font-size: 1.0625rem; }
.prose p, .prose ul { margin: 0.75rem 0 0; }
.prose ul { padding-left: 1.2rem; }
.prose li + li { margin-top: 0.35rem; }
.prose .summary {
  margin-top: 0;
  padding: 1.25rem 1.4rem;
  background: var(--bg-alt);
  border-left: 4px solid var(--surf);
}

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

.site-footer {
  background: var(--bg-alt);
  border-top: 1px solid var(--rule);
  padding-block: 2.5rem 2rem;
  font-size: 0.9375rem;
}
.footer-main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem 3rem;
}
.footer-brand { display: flex; align-items: center; gap: 0.875rem; }
.footer-brand img { width: 40px; height: 40px; }
.footer-brand p { margin: 0; line-height: 1.4; }
.footer-links { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; }
.footer-links a { overflow-wrap: anywhere; }
.footer-fine { margin-top: 2rem; font-size: 0.8125rem; color: var(--ink-soft); }
.footer-fine p { margin: 0.5rem 0 0; max-width: 60rem; }

/* ---------- Narrow screens ---------- */

@media (max-width: 760px) {
  .split, .split--even, .section-head, .entry { grid-template-columns: minmax(0, 1fr); }
  .section-head { align-items: start; }
  .entry { gap: 0.5rem; }
}
@media (max-width: 480px) {
  .brand-word { font-size: 1.375rem; }
  .brand img { width: 40px; height: 40px; }
  .site-nav ul { gap: 0.25rem 1.1rem; }
}
