/* ============================================================
   Optimist Sailing Guide — stylesheet
   Designed to work with no external dependencies.
   ============================================================ */

:root {
  --navy: #0b3a67;
  --navy-dark: #072a4d;
  --sea: #2a9dd6;
  --sea-light: #e8f4fb;
  --sand: #f5efe4;
  --sand-dark: #e6d9c4;
  --ink: #1d2733;
  --muted: #5a6775;
  --white: #ffffff;
  --accent: #e8a13c;
  --danger: #c0392b;
  --ok: #2e8b57;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--sea-light);
  line-height: 1.65;
  font-size: 17px;
}

.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------------- header ---------------- */
.site-header {
  background: linear-gradient(160deg, var(--navy) 0%, var(--navy-dark) 100%);
  color: var(--white);
  border-bottom: 6px solid var(--accent);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 22px 0 10px;
}

.brand-logo {
  font-size: 40px;
  line-height: 1;
}

.brand-title {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.brand-sub {
  color: #bcd8ec;
  font-size: 0.95rem;
}

/* ---------------- nav ---------------- */
.site-nav {
  background: var(--navy-dark);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.nav-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
}

.site-nav a {
  display: block;
  padding: 14px 18px;
  color: #dceaf5;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.98rem;
  letter-spacing: 0.3px;
  border-bottom: 3px solid transparent;
}

.site-nav a:hover,
.site-nav a.active {
  color: var(--white);
  background: rgba(255, 255, 255, 0.08);
  border-bottom-color: var(--accent);
}

/* ---------------- hero ---------------- */
.hero {
  background: linear-gradient(150deg, #0f4c81 0%, var(--sea) 70%, #5dc1e8 100%);
  color: var(--white);
  text-align: center;
  padding: 64px 24px 56px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 12% 80%, rgba(255, 255, 255, 0.12) 0 8px, transparent 9px),
    radial-gradient(circle at 80% 30%, rgba(255, 255, 255, 0.10) 0 6px, transparent 7px),
    radial-gradient(circle at 60% 85%, rgba(255, 255, 255, 0.08) 0 11px, transparent 12px),
    linear-gradient(180deg, transparent 0%, rgba(7, 42, 77, 0.4) 100%);
}

.hero-inner {
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-size: clamp(1.9rem, 4.5vw, 3rem);
  margin-bottom: 14px;
  letter-spacing: 0.4px;
}

.hero p {
  font-size: clamp(1rem, 2vw, 1.2rem);
  max-width: 680px;
  margin: 0 auto 26px;
  color: #eaf6fd;
}

.hero-cta {
  display: inline-block;
  background: var(--accent);
  color: var(--navy-dark);
  font-weight: 700;
  padding: 14px 34px;
  border-radius: 999px;
  text-decoration: none;
  letter-spacing: 0.5px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.hero-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.3);
}

/* ---------------- main ---------------- */
main {
  padding: 48px 0 64px;
}

.page-title {
  color: var(--navy);
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.lede {
  color: var(--muted);
  font-size: 1.08rem;
  margin-bottom: 36px;
  max-width: 760px;
}

section {
  margin-bottom: 40px;
}

h2 {
  color: var(--navy);
  font-size: 1.5rem;
  font-weight: 700;
  margin: 30px 0 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--sand-dark);
}

h2 .step-num {
  display: inline-block;
  min-width: 36px;
  height: 36px;
  line-height: 36px;
  text-align: center;
  background: var(--accent);
  color: var(--navy-dark);
  border-radius: 50%;
  font-size: 1.1rem;
  margin-right: 10px;
}

h3 {
  color: var(--navy-dark);
  font-size: 1.2rem;
  margin: 22px 0 8px;
}

p {
  margin-bottom: 14px;
}

ul, ol {
  margin: 0 0 16px 24px;
}

li {
  margin-bottom: 8px;
}

li > ul, li > ol {
  margin-top: 8px;
}

/* ---------------- definition lists ---------------- */
dl {
  margin: 0 0 18px;
}

dt {
  margin: 14px 0 4px;
  color: var(--navy-dark);
  font-weight: 700;
}

dd {
  margin: 0 0 6px 22px;
  color: var(--ink);
  border-left: 3px solid var(--sand-dark);
  padding-left: 14px;
}

/* ---------------- cards ---------------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 22px;
}

.card {
  background: var(--white);
  border-radius: 14px;
  padding: 22px;
  box-shadow: 0 2px 12px rgba(11, 58, 103, 0.08);
  border-top: 5px solid var(--sea);
  display: flex;
  flex-direction: column;
}

.card-icon {
  font-size: 30px;
  margin-bottom: 6px;
}

.card h3 {
  margin: 6px 0 8px;
}

.card p {
  color: var(--muted);
  font-size: 0.98rem;
  flex: 1;
  margin-bottom: 14px;
}

.card a.cta {
  align-self: flex-start;
  color: var(--navy);
  font-weight: 700;
  text-decoration: none;
  border-bottom: 2px solid var(--accent);
  padding-bottom: 1px;
}

.card a.cta:hover {
  color: var(--sea);
}

/* ---------------- callouts ---------------- */
.callout {
  border-radius: 12px;
  padding: 18px 20px;
  margin: 20px 0;
  border-left: 6px solid;
}

.callout-tip {
  background: #fff8e6;
  border-color: var(--accent);
}

.callout-warn {
  background: #fdecea;
  border-color: var(--danger);
}

.callout-info {
  background: #dcedf9;
  border-color: var(--sea);
}

.callout strong {
  display: block;
  margin-bottom: 4px;
  font-size: 0.98rem;
  letter-spacing: 0.4px;
}

.callout p {
  margin-bottom: 0;
}

/* ---------------- tables ---------------- */
.table-wrap {
  overflow-x: auto;
  margin: 18px 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  font-size: 0.95rem;
}

caption {
  text-align: left;
  font-weight: 700;
  color: var(--navy);
  padding: 8px 4px;
}

th, td {
  border: 1px solid var(--sand-dark);
  padding: 10px 14px;
  text-align: left;
  vertical-align: top;
}

th {
  background: var(--navy);
  color: var(--white);
  font-weight: 600;
  letter-spacing: 0.3px;
}

tbody tr:nth-child(even) {
  background: #f7fbfd;
}

/* ---------------- prev/next nav ---------------- */
.next-prev {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 2px solid var(--sand-dark);
}

.next-prev a {
  background: var(--white);
  color: var(--navy);
  font-weight: 700;
  padding: 12px 20px;
  border-radius: 10px;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(11, 58, 103, 0.1);
  border-bottom: 3px solid var(--sea);
}

.next-prev a:hover {
  border-bottom-color: var(--accent);
  color: var(--navy-dark);
}

/* ---------------- footer ---------------- */
.site-footer {
  background: var(--navy-dark);
  color: #abc4d8;
  padding: 26px 0;
  font-size: 0.9rem;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
}

.site-footer a {
  color: var(--accent);
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

/* ---------------- waves decoration ---------------- */
.wave {
  display: block;
  width: 100%;
  height: 70px;
  background: url('data:image/svg+xml;charset=utf-8,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 1440 70%22 preserveAspectRatio=%22none%22%3E%3Cpath fill=%22%23e8f4fb%22 d=%22M0 40 C 240 70, 480 10, 720 30 C 960 50, 1200 20, 1440 45 L 1440 70 L 0 70 Z%22/%3E%3C/svg%3E') no-repeat center / cover;
}

/* ---------------- code / keycaps ---------------- */
kbd {
  background: var(--navy-dark);
  color: var(--white);
  padding: 2px 8px;
  border-radius: 5px;
  font-family: inherit;
  font-size: 0.92em;
}

/* ---------------- responsive ---------------- */
@media (max-width: 640px) {
  main { padding: 28px 0 40px; }
  .hero { padding: 44px 20px 40px; }
  .brand-title { font-size: 1.3rem; }
  .site-nav a { flex: 1 1 auto; text-align: center; font-size: 0.92rem; padding: 12px 10px; }
  h2 { font-size: 1.3rem; }
  .card-grid { grid-template-columns: 1fr; }
  body { font-size: 16px; }
}
