/* Blakeney Pit Sailing — development journal
   Harbour light. Logbook paper. A burgundy sail. */

:root {
  --ink: #15262b;
  --ink-soft: #4d646a;
  --paper: #f3efe6;
  --paper-deep: #e7e1d4;
  --deep: #0b2430;
  --deep-soft: #163642;
  --sail: #8a2f38;
  --water: #2f6d7c;
  --gold: #c4a36a;
  --line: rgba(21, 38, 43, 0.1);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --sans: "Satoshi", "Avenir Next", "Segoe UI", sans-serif;
  --measure: 38rem;
}

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

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  -webkit-tap-highlight-color: rgba(21, 38, 43, 0.12);
}

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

video {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
}

.skip:focus {
  left: 16px;
  top: 16px;
  z-index: 100;
  background: var(--paper);
  padding: 10px 14px;
  border-radius: 10px;
}

/* ——— Top bar ——— */
.top {
  position: fixed;
  inset: 0 0 auto;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(10px + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) 12px max(16px, env(safe-area-inset-left, 0px));
  color: var(--ink);
  background: rgba(243, 239, 230, 0.9);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  border-bottom: 1px solid var(--line);
}

.top-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  font-weight: 700;
  font-size: 1.02rem;
  letter-spacing: -0.02em;
}

.top-mark {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  object-fit: cover;
}

.top-nav {
  display: flex;
  gap: 22px;
}

.top-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 0.92rem;
  font-weight: 600;
  padding: 8px 8px;
  opacity: 0.82;
  touch-action: manipulation;
}

.top-nav a[aria-current="page"],
.top-nav a:hover {
  opacity: 1;
}

/* ——— Shared type ——— */
.wrap {
  width: min(1120px, calc(100% - 32px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)));
  margin-inline: auto;
}

.eyebrow {
  margin: 0 0 12px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--water);
}

.display {
  margin: 0;
  font-family: var(--sans);
  font-size: clamp(2.1rem, 5vw, 3.6rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.08;
}

.lede,
.prose p {
  margin: 18px 0 0;
  font-size: 1.12rem;
  line-height: 1.6;
  color: var(--ink-soft);
}

.prose p + p {
  margin-top: 1.15em;
}

.prose h2 {
  margin: 2.4em 0 0;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.25;
  color: var(--ink);
}

.prose h2 + p {
  margin-top: 0.85em;
}

.prose strong {
  font-weight: 700;
  color: var(--ink);
}

.prose a {
  color: var(--water);
  font-weight: 600;
  border-bottom: 1px solid rgba(47, 109, 124, 0.35);
}

.prose a strong {
  color: inherit;
}

/* ——— Reveal ——— */
.reveal {
  opacity: 1;
  transform: none;
}

.js .reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}

.js .reveal.is-in {
  opacity: 1;
  transform: none;
}

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

  html {
    scroll-behavior: auto;
  }
}

/* ——— Journal list ——— */
.log {
  padding: 0 0 120px;
}

.home-log {
  padding-top: calc(140px + env(safe-area-inset-top, 0px));
}

.log-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}

.log-all {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--water);
  border-bottom: 1px solid rgba(47, 109, 124, 0.3);
  touch-action: manipulation;
}

.log-card {
  display: grid;
  gap: 0;
  overflow: hidden;
  border-radius: 22px;
  background: #fffdf8;
  box-shadow: 0 24px 60px rgba(21, 38, 43, 0.08);
  color: inherit;
  touch-action: manipulation;
}

@media (min-width: 860px) {
  .log-card {
    grid-template-columns: 1.15fr 0.85fr;
    min-height: 380px;
  }
}

.log-card img {
  width: 100%;
  height: 100%;
  min-height: 240px;
  object-fit: cover;
  object-position: center 42%;
  transition: transform 1.2s var(--ease);
}

.log-card:hover img {
  transform: scale(1.03);
}

.log-card-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(28px, 4vw, 48px);
}

.log-card time {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--water);
}

.log-card h2,
.log-card h3 {
  margin: 10px 0 0;
  font-family: var(--sans);
  font-size: clamp(1.7rem, 3vw, 2.3rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.15;
}

.log-card p {
  margin: 12px 0 0;
  font-size: 1.05rem;
  line-height: 1.5;
  color: var(--ink-soft);
}

.log-card .more {
  margin-top: 22px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--sail);
}

.log-empty {
  padding: 48px 8px;
  color: var(--ink-soft);
}

.log-stack {
  display: grid;
  gap: 22px;
}

.log-row {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 28px;
  align-items: center;
  padding: 28px 0;
  border-top: 1px solid var(--line);
  color: inherit;
}

.log-row img {
  width: 200px;
  height: 120px;
  object-fit: cover;
  border-radius: 12px;
}

.log-row time {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--water);
}

.log-row h2,
.log-row h3 {
  margin: 0;
  font-family: var(--sans);
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.log-row p {
  margin: 6px 0 0;
  color: var(--ink-soft);
}

@media (max-width: 720px) {
  .log-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .log-row img {
    width: 100%;
    height: 200px;
  }
}

/* ——— Entry ——— */
.entry {
  padding: calc(128px + env(safe-area-inset-top, 0px)) 0 40px;
}

.entry-head {
  max-width: var(--measure);
  margin: 0 auto 48px;
}

.entry-head time {
  display: block;
  margin-bottom: 14px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--water);
}

.entry-head h1 {
  margin: 0;
  font-family: var(--sans);
  font-size: clamp(2.4rem, 6vw, 3.8rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.05;
}

.entry-media {
  margin: 0 auto 56px;
  width: min(1080px, calc(100% - 32px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)));
  border-radius: 18px;
  overflow: hidden;
  background: var(--deep);
  box-shadow: 0 28px 70px rgba(11, 36, 48, 0.18);
}

.entry-media video,
.entry-media img {
  width: 100%;
  height: auto;
}

.entry-body {
  max-width: var(--measure);
  margin: 0 auto;
  padding-bottom: 48px;
}

.shot {
  display: block;
  width: min(1080px, calc(100% - 32px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)));
  margin: 36px auto;
}

.shot img {
  width: 100%;
  height: auto;
  border-radius: 14px;
  box-shadow: 0 18px 40px rgba(11, 36, 48, 0.12);
}

.shot figcaption {
  margin-top: 12px;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--ink-soft);
  text-align: center;
}

.entry-nav {
  max-width: var(--measure);
  margin: 0 auto 100px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.entry-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--water);
  touch-action: manipulation;
}

/* ——— Page header for journal index ——— */
.page-head {
  padding: calc(140px + env(safe-area-inset-top, 0px)) 0 36px;
}

.page-head .display {
  max-width: 14em;
}

.page-head .lede {
  max-width: 36em;
}

/* ——— Footer ——— */
.footer {
  padding: 72px 0 48px;
  text-align: center;
  border-top: 1px solid var(--line);
}

.footer-brand {
  margin: 0;
  font-family: var(--sans);
  font-size: 1.5rem;
  font-weight: 700;
}

.footer-line {
  margin: 8px 0 0;
  color: var(--ink-soft);
}

.footer-copy {
  margin: 28px 0 0;
  font-size: 0.75rem;
  letter-spacing: 0.02em;
  color: rgba(77, 100, 106, 0.8);
}

.footer a {
  font-weight: 600;
  color: var(--water);
  border-bottom: 1px solid rgba(47, 109, 124, 0.3);
}

/* ——— 404 ——— */
.lost {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: calc(120px + env(safe-area-inset-top, 0px)) max(24px, env(safe-area-inset-right, 0px)) calc(48px + env(safe-area-inset-bottom, 0px)) max(24px, env(safe-area-inset-left, 0px));
  text-align: center;
}

@media (max-width: 700px) {
  .top-nav {
    gap: 8px;
  }

  .entry-head h1 {
    font-size: clamp(2rem, 9vw, 2.8rem);
  }

  .log-card img {
    min-height: 200px;
    height: 220px;
  }
}
