/* ============================================================
   GUY IN THE MIDDLE OF NOWHERE IN THE OCEAN
   HOC-faithful design system — paper #EDE9E8, ink #14183E,
   red-700 accent, Libre Baskerville italic caps + Inter.
   Tropical injected via art, copy, and sea accents.
   ============================================================ */

:root {
  --paper: #EDE9E8;
  --ink: #14183E;
  --sub: #5E6282;
  --red: #B91C1C;
  --red-bright: #EF4444;
  --white: #FFFFFF;
  --gray-50: #F9FAFB;
  --gray-100: #F3F4F6;
  --gray-200: #E5E7EB;
  --gray-400: #9CA3AF;
  --sea: #0E8C96;
  --sea-light: #57C4CC;
  --palm: #2E7D32;
  --sun: #F2B705;

  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-display: "Libre Baskerville", Georgia, serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow-card: 0 1px 2px rgba(20, 24, 62, 0.05), 0 4px 16px rgba(20, 24, 62, 0.06);
  --shadow-lift: 0 2px 4px rgba(20, 24, 62, 0.06), 0 12px 32px rgba(20, 24, 62, 0.10);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--red); color: #fff; }

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

.container { width: 100%; max-width: 72rem; margin: 0 auto; padding: 0 1.5rem; }
@media (min-width: 1024px) { .container { padding: 0 3rem; } }

/* ---------- Typography ---------- */

.display {
  font-family: var(--font-display);
  font-weight: 700;
  font-style: italic;
  text-transform: uppercase;
  color: var(--ink);
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.h-hero { font-size: clamp(2rem, 5.2vw, 3.4rem); }
.h-section { font-size: clamp(1.6rem, 3.4vw, 2.4rem); }
.h-card { font-size: clamp(1.15rem, 2vw, 1.35rem); }

.eyebrow {
  color: var(--red);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.16em;
}
.eyebrow::before { content: "// "; opacity: 0.85; }

.sub { color: var(--sub); }

.mono {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.02em;
}

/* ---------- Nav ---------- */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--gray-200);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 72rem;
  height: 4rem;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.brand { display: flex; align-items: center; gap: 0.7rem; }
.brand-mark {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  background: var(--ink);
  border-radius: 10px;
  overflow: hidden;
}
.brand-mark img { width: 100%; height: 100%; object-fit: cover; }
.brand-name {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.08em;
}
.brand-name .dot { color: var(--red); }

.nav-links { display: none; gap: 2.5rem; align-items: center; }
.nav-links a { font-size: 0.95rem; font-weight: 500; color: var(--ink); transition: color 0.15s; }
.nav-links a:hover { color: var(--red); }

.nav-burger {
  display: grid; place-items: center;
  width: 2.75rem; height: 2.75rem;
  border: none; border-radius: var(--radius-sm);
  background: var(--gray-100);
  color: var(--ink);
}
.nav-burger svg { width: 1.4rem; height: 1.4rem; }

.mobile-menu {
  position: fixed; inset: 0; z-index: 50;
  display: none;
  align-items: center; justify-content: center;
  background: rgba(237, 233, 232, 0.97);
  backdrop-filter: blur(6px);
}
.mobile-menu.open { display: flex; }
.mobile-menu nav { display: flex; flex-direction: column; gap: 1.75rem; text-align: center; }
.mobile-menu a {
  font-family: var(--font-display);
  font-style: italic; font-weight: 700;
  text-transform: uppercase;
  font-size: 1.75rem;
  color: var(--ink);
}
.mobile-menu a:hover { color: var(--red); }
.mobile-menu .close-btn {
  position: absolute; top: 1.5rem; right: 1.5rem;
  width: 2.75rem; height: 2.75rem;
  border: none; border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--ink);
}

@media (min-width: 768px) {
  .nav-links { display: flex; }
  .nav-burger { display: none; }
}

/* ---------- Hero ---------- */

.hero { margin-top: 8rem; }
.hero-grid {
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  justify-content: space-between;
  gap: 3rem;
}
.hero-text { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 1.4rem; width: 100%; }
.hero-text .display { margin-top: 0.35rem; }
.hero-text .accent-red { color: var(--red); }
.hero-sub { max-width: 34rem; color: var(--sub); font-size: 1.05rem; }

.hero-cta { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.9rem; margin-top: 0.4rem; }

.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.8rem 1.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-weight: 600; font-size: 0.95rem;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}
.btn:hover { transform: translateY(-1px); }
.btn-red { background: var(--red-bright); color: #fff; }
.btn-red:hover { background: #dc2626; box-shadow: 0 6px 16px rgba(239, 68, 68, 0.35); }
.btn-ghost { background: var(--white); color: var(--ink); border-color: var(--gray-200); }
.btn-ghost:hover { border-color: var(--ink); }


@media (min-width: 1024px) {
  .hero-grid { flex-direction: row; }
  .hero-text { align-items: flex-start; text-align: left; width: auto; }
  .hero-cta { justify-content: flex-start; }
  .hero-art { max-width: 26rem; }
}

/* ---------- Ticker ---------- */

.ticker {
  margin-top: 6rem;
  overflow: hidden;
  border-top: 1px solid var(--gray-200);
  border-bottom: 1px solid var(--gray-200);
  background: var(--white);
  padding: 0.85rem 0;
  white-space: nowrap;
}
.ticker-track {
  display: inline-flex;
  gap: 3rem;
  padding-right: 3rem;
  animation: ticker-scroll 28s linear infinite;
  will-change: transform;
}
.ticker span {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
}
.ticker .sep { color: var(--red); }
@keyframes ticker-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

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

main { display: flex; flex-direction: column; gap: 6rem; margin-top: 5rem; }
@media (min-width: 768px) { main { gap: 10rem; } }

.section-head { display: flex; flex-direction: column; gap: 0.6rem; margin-bottom: 3rem; text-align: center; align-items: center; }
.section-head .sub { max-width: 36rem; }

/* ---------- Cards ---------- */

.card-row { display: flex; flex-direction: column; gap: 1.75rem; }
@media (min-width: 1024px) { .card-row { flex-direction: row; } .card-row > * { flex: 1; } }

.card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 2.5rem 2rem;
  box-shadow: var(--shadow-card);
  display: flex; flex-direction: column; gap: 0.9rem;
  align-items: center; text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover { transform: scale(1.04); box-shadow: var(--shadow-lift); }
.card .eyebrow { font-size: 0.8rem; }
.card p { color: var(--sub); max-width: 26rem; }
.card .card-icon { font-size: 1.6rem; line-height: 1; }

/* ---------- Caption cards (HOC "Example Program" motif) ---------- */

.caption-card {
  position: relative;
  border-radius: var(--radius-sm);
  border: 2px solid var(--gray-100);
  padding: 1.25rem;
  background: var(--gray-100);
  transition: transform 0.2s ease;
}
.caption-card:hover { transform: scale(1.03); }
.caption-card .frame { border-radius: var(--radius-sm); overflow: hidden; background: var(--white); }
.caption-card .frame img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }

.caption {
  position: absolute;
  left: 1.25rem; right: 1.25rem;
  bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  background: var(--white);
  border: 2px solid var(--white);
  border-radius: var(--radius-sm);
  padding: 0.8rem 1rem;
  box-shadow: var(--shadow-card);
}
.caption .cap-title { font-weight: 700; font-size: 0.9rem; line-height: 1.3; }
.caption .cap-sub { font-size: 0.8rem; color: var(--sub); }
.caption .cap-link {
  color: var(--red);
  font-weight: 600;
  font-size: 0.85rem;
  text-decoration: underline;
  white-space: nowrap;
}
.caption .cap-link:hover { color: var(--ink); }

@media (min-width: 1024px) {
  .caption-card-row { display: flex; gap: 1.75rem; }
  .caption-card-row > * { flex: 1; }
}

/* ---------- Beach cam terminal ---------- */

.beach-cam {
  background: var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lift);
  width: 100%;
  max-width: 40rem;
  margin: 0 auto;
  overflow: hidden;
}
.beach-cam .cam-bar {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.8rem 1.1rem;
  background: rgba(255,255,255,0.06);
  border-bottom: 1px solid rgba(255,255,255,0.12);
}
.beach-cam .dot { width: 11px; height: 11px; border-radius: 50%; }
.beach-cam .dot.r { background: #F87171; }
.beach-cam .dot.y { background: #FBBF24; }
.beach-cam .dot.g { background: #34D399; }
.beach-cam .cam-title {
  margin-left: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: rgba(237,233,232,0.7);
  text-transform: uppercase;
}
.beach-cam pre {
  padding: 1.4rem 1.5rem 1.6rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.9;
  color: #EDE9E8;
  overflow-x: auto;
  white-space: pre;
}
.beach-cam .k { color: var(--sea-light); }
.beach-cam .v { color: #EDE9E8; }
.beach-cam .warn { color: var(--sun); }
.beach-cam .rec {
  display: inline-flex; align-items: center; gap: 0.4rem;
  color: #F87171;
  font-weight: 600;
}
.beach-cam .rec::before {
  content: "";
  width: 9px; height: 9px; border-radius: 50%;
  background: #F87171;
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }

.cursor { display: inline-block; width: 0.6em; height: 1.05em; background: #EDE9E8; vertical-align: -0.2em; animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }

/* ---------- CTA band ---------- */

.cta-band {
  position: relative;
  background: rgba(243, 244, 246, 0.6);
  border-radius: var(--radius);
  padding: 5rem 1.5rem;
  text-align: center;
  overflow: hidden;
}
.cta-band .cta-inner { display: flex; flex-direction: column; align-items: center; gap: 1.2rem; max-width: 40rem; margin: 0 auto; }
.cta-band .sub { font-size: 1.05rem; }

.cta-form { display: flex; flex-direction: column; gap: 0.5rem; width: 100%; max-width: 26rem; margin-top: 0.6rem; }
.cta-form input {
  flex: 1;
  padding: 0.85rem 1rem;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  background: var(--white);
  font-size: 0.95rem;
  color: var(--ink);
  outline: none;
}
.cta-form input:focus { border-color: var(--ink); }
.cta-form .btn { justify-content: center; }
@media (min-width: 768px) {
  .cta-form { flex-direction: row; }
  .cta-form .btn { padding-top: 0.85rem; padding-bottom: 0.85rem; }
}

.cta-note { font-size: 0.85rem; color: var(--sub); }
.cta-socials { display: flex; gap: 1.4rem; margin-top: 1rem; }
.cta-socials a { color: var(--ink); font-weight: 500; font-size: 0.95rem; }
.cta-socials a:hover { color: var(--red); }

.cta-wave { position: absolute; bottom: -3px; left: 0; right: 0; opacity: 0.5; pointer-events: none; }

/* ---------- Blog ---------- */

.blog-hero { margin-top: 8rem; display: flex; flex-direction: column; align-items: center; gap: 1.2rem; text-align: center; }
.blog-hero .sub { max-width: 34rem; }

.post-list { display: flex; flex-direction: column; gap: 2.5rem; }

.post-card {
  display: flex;
  flex-direction: column;
  gap: 1.6rem;
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow-card);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.post-card:hover { transform: scale(1.015); box-shadow: var(--shadow-lift); }
.post-card .post-art { border-radius: var(--radius-sm); overflow: hidden; }
.post-card .post-art img { width: 100%; aspect-ratio: 3 / 1.6; object-fit: cover; }
.post-card .post-body { display: flex; flex-direction: column; gap: 0.7rem; padding: 0 0.6rem 0.8rem; }
.post-meta { display: flex; align-items: center; gap: 0.75rem; color: var(--sub); }
.post-meta .ep {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--red);
  background: rgba(185, 28, 28, 0.08);
  border: 1px solid rgba(185, 28, 28, 0.2);
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
}
.post-card h3 { font-size: 1.35rem; }
.post-card p { color: var(--sub); max-width: 52rem; }
.post-card .read-link { color: var(--red); font-weight: 600; text-decoration: underline; width: fit-content; }
.post-card .read-link:hover { color: var(--ink); }

@media (min-width: 768px) {
  .post-card { flex-direction: row; align-items: stretch; }
  .post-card .post-art { flex: 0 0 42%; }
  .post-card .post-art img { aspect-ratio: auto; height: 100%; object-fit: cover; }
  .post-card .post-body { justify-content: center; }
}

/* ---------- Post page ---------- */

.article { max-width: 44rem; margin: 0 auto; }
.article .back {
  display: inline-flex; align-items: center; gap: 0.4rem;
  color: var(--red); font-weight: 600; font-size: 0.9rem;
  margin-bottom: 3rem;
}
.article .back:hover { color: var(--ink); }
.article header { display: flex; flex-direction: column; gap: 1.1rem; margin-bottom: 2.5rem; }
.article header h1 { font-size: clamp(1.7rem, 3.6vw, 2.4rem); }
.article .lead { font-size: 1.1rem; color: var(--sub); }
.article .hero-img { border-radius: var(--radius); overflow: hidden; border: 4px solid var(--white); box-shadow: var(--shadow-card); margin-bottom: 2.5rem; }

.article-body { display: flex; flex-direction: column; gap: 1.35rem; }
.article-body p { font-size: 1.03rem; line-height: 1.8; color: #1F2340; }
.article-body h2 {
  font-family: var(--font-display);
  font-style: italic; font-weight: 700;
  text-transform: uppercase;
  font-size: 1.3rem;
  margin-top: 1.2rem;
}
.article-body blockquote {
  border-left: 3px solid var(--red);
  padding: 0.4rem 0 0.4rem 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--sub);
  font-style: normal;
}
.article-body hr { border: none; border-top: 1px solid var(--gray-200); margin: 1.5rem 0; }
.article-body code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: 4px;
  padding: 0.1em 0.4em;
}
.article-body a { color: var(--red); font-weight: 600; text-decoration: underline; }
.article-body a:hover { color: var(--ink); }

.post-nav {
  display: flex; justify-content: space-between; gap: 1rem;
  margin-top: 4rem; padding-top: 2rem;
  border-top: 1px solid var(--gray-200);
}
.post-nav a { display: flex; flex-direction: column; gap: 0.25rem; max-width: 45%; }
.post-nav .dir { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gray-400); }
.post-nav .t { font-weight: 600; color: var(--ink); }
.post-nav a:hover .t { color: var(--red); }
.post-nav .next { text-align: right; align-items: flex-end; }

/* ---------- 404 ---------- */

.notfound { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.4rem; text-align: center; padding: 2rem; }
.notfound .mascot { width: 9rem; animation: bob 3.5s ease-in-out infinite; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
.notfound .mono { color: var(--sub); }

/* ---------- Reveal animations (HOC fade-down) ---------- */

.reveal { opacity: 0; transform: translateY(-1.5rem); transition: opacity 0.8s ease, transform 0.8s ease; }
.reveal.in { opacity: 1; transform: translateY(0); }
.d1 { transition-delay: 0.1s; } .d2 { transition-delay: 0.25s; } .d3 { transition-delay: 0.4s; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .ticker-track { animation: none; }
}

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

footer {
  margin-top: 6rem;
  background: var(--white);
  padding: 1.6rem 0;
  border-top: 1px solid var(--gray-200);
}
.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  text-align: center;
  color: var(--sub);
  font-size: 0.78rem;
}
.footer-inner .links { display: flex; gap: 1.5rem; }
.footer-inner .links a { color: var(--ink); font-weight: 500; }
.footer-inner .links a:hover { color: var(--red); }

/* ---------- Search ---------- */

.nav-search {
  display: grid; place-items: center;
  width: 2.5rem; height: 2.5rem;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--ink);
  transition: border-color 0.15s, color 0.15s;
}
.nav-search:hover { border-color: var(--ink); color: var(--red); }
.nav-search svg { width: 1.15rem; height: 1.15rem; }

.mobile-menu .search-item {
  background: none; border: none;
  font-family: var(--font-display);
  font-style: italic; font-weight: 700;
  text-transform: uppercase;
  font-size: 1.4rem;
  color: var(--ink);
}
.mobile-menu .search-item:hover { color: var(--red); }

.search-overlay {
  position: fixed; inset: 0; z-index: 90;
  display: flex; align-items: flex-start; justify-content: center;
  padding: 6vh 1.25rem 1.25rem;
  background: rgba(20, 24, 62, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.search-overlay[hidden] { display: none; }

.search-panel {
  width: 100%; max-width: 40rem;
  background: var(--paper);
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lift);
  overflow: hidden;
  display: flex; flex-direction: column;
}

.search-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.9rem 1.25rem;
  background: var(--ink);
  color: var(--paper);
}
.search-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.search-close {
  width: 2rem; height: 2rem;
  display: grid; place-items: center;
  background: transparent; border: none;
  color: var(--paper);
}
.search-close:hover { color: var(--sea-light); }
.search-close svg { width: 1.1rem; height: 1.1rem; }

.search-input {
  padding: 1.1rem 1.25rem;
  border: none; border-bottom: 2px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 1.15rem;
  outline: none;
}
.search-input::placeholder { color: var(--gray-400); }

.search-status { padding: 0.6rem 1.25rem 0; color: var(--sub); }

.search-results { list-style: none; max-height: 46vh; overflow-y: auto; }
.search-results li { border-top: 1px solid var(--gray-200); }
.search-results a { display: block; padding: 0.9rem 1.25rem; }
.search-results a:hover { background: var(--white); }
.sr-title { display: block; font-weight: 700; color: var(--ink); }
.sr-meta { display: block; margin-top: 0.15rem; color: var(--red); }
.sr-snippet { display: block; margin-top: 0.3rem; font-size: 0.9rem; color: var(--sub); }
.search-results mark { background: transparent; color: var(--red); font-weight: 700; }
.search-empty { padding: 1.25rem; color: var(--sub); }

.search-hint {
  padding: 0.7rem 1.25rem 1rem;
  color: var(--gray-400);
  border-top: 1px solid var(--gray-200);
}
.search-hint kbd {
  font-family: var(--font-mono);
  border: 1px solid var(--gray-200);
  border-radius: 4px;
  padding: 0 0.35rem;
  background: var(--white);
}
