:root {
  --color-sand: #f3e9d8;
  --color-ivory: #fffaf2;
  --color-charcoal: #262626;
  --color-ocean: #0e6e8c;
  --color-ocean-dark: #094a5f;
  --color-border: #d8cdbe;
  --color-shadow: rgba(38, 38, 38, 0.08);
  --color-shadow-hover: rgba(38, 38, 38, 0.16);
  --font-serif: Georgia, "Times New Roman", serif;
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --radius: 4px;
  --max-width: 1100px;
}

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

html {
  font-size: 100%;
  background-color: var(--color-sand);
  color: var(--color-charcoal);
  font-family: var(--font-sans);
  line-height: 1.6;
}

body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-wrap: anywhere;
  hyphens: auto;
}

a {
  color: var(--color-ocean);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--color-ocean-dark);
}

:focus-visible {
  outline: 3px solid var(--color-ocean);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  top: -999px;
  left: 1rem;
  background: var(--color-ocean);
  color: var(--color-ivory);
  padding: 0.75rem 1.25rem;
  z-index: 1000;
  border-radius: var(--radius);
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  top: 1rem;
}

/* Slim and simple header (moves up on scroll, not sticky) */
.site-header {
  background-color: var(--color-ivory);
  border-bottom: 1px solid var(--color-border);
  position: relative;
  z-index: 100;
  width: 100%;
}

.header-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0.55rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--color-charcoal);
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1.2;
  white-space: nowrap;
}

.brand-wrap:hover {
  color: var(--color-ocean);
}

.brand-mark {
  width: 22px;
  height: 22px;
  fill: var(--color-ocean);
  flex-shrink: 0;
}

.nav-desktop {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.15rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-desktop a {
  text-decoration: none;
  font-size: 0.9rem;
  color: var(--color-charcoal);
  font-weight: 500;
  padding: 0.2rem 0;
}

.nav-desktop a:hover {
  color: var(--color-ocean);
}

.btn-header {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--color-ocean);
  color: var(--color-ocean);
  background: transparent;
  font-size: 0.75rem;
  letter-spacing: 0.02em;
  font-weight: 600;
  border-radius: var(--radius);
  text-decoration: none;
  white-space: nowrap;
  line-height: 1.3;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.btn-header:hover {
  background-color: var(--color-ocean);
  color: var(--color-ivory);
}

/* 3-dot menu toggle button for small screens */
.menu-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--color-border);
  padding: 0;
  width: 36px;
  height: 36px;
  color: var(--color-charcoal);
  border-radius: var(--radius);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.menu-toggle:hover {
  background-color: var(--color-sand);
  border-color: #c9bea7;
  color: var(--color-ocean);
}

.menu-dots-icon {
  display: block;
}

.mobile-nav-panel {
  display: none;
}

/* Sections and bands */
main {
  flex: 1;
}

.band-ocean {
  background-color: var(--color-ocean);
  color: var(--color-ivory);
  padding: 3.5rem 1.25rem;
}

.band-ocean h1 {
  color: var(--color-ivory);
  font-family: var(--font-serif);
  font-size: 2.25rem;
  line-height: 1.2;
  margin: 0 0 1rem 0;
  max-width: 900px;
}

.band-ocean p {
  color: #e5f1f5;
  font-size: 1.1rem;
  max-width: 800px;
  margin: 0;
}

.band-sand {
  background-color: var(--color-sand);
  padding: 3.5rem 1.25rem;
  position: relative;
}

.band-ivory {
  background-color: var(--color-ivory);
  padding: 3.5rem 1.25rem;
  position: relative;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  min-width: 0;
}

.reading-column {
  max-width: 760px;
  margin: 0 auto;
}

/* Headings */
h1, h2, h3, h4 {
  font-family: var(--font-serif);
  color: var(--color-charcoal);
  line-height: 1.25;
  margin-top: 0;
}

h1 {
  font-size: 2.2rem;
  margin-bottom: 1.25rem;
}

h2 {
  font-size: 1.65rem;
  margin-bottom: 1rem;
  margin-top: 2rem;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 0.4rem;
}

h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
  margin-top: 1.5rem;
}

/* Breadcrumbs */
.breadcrumb-nav {
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}

.breadcrumb-nav ol {
  display: flex;
  gap: 0.5rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.breadcrumb-nav li + li::before {
  content: "›";
  margin-right: 0.5rem;
  color: #767676;
}

/* Cards Grid */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.card {
  background-color: var(--color-ivory);
  padding: 1.5rem;
  border-radius: var(--radius);
  box-shadow: 0 2px 8px var(--color-shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px var(--color-shadow-hover);
}

.card h3 {
  margin-top: 0;
}

.card p {
  flex-grow: 1;
  font-size: 0.95rem;
  color: #3e3e3e;
}

.card-link {
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  margin-top: 1rem;
  display: inline-block;
}

/* Buttons */
.btn-primary {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background-color: var(--color-ocean);
  color: var(--color-ivory);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: var(--radius);
  border: 1px solid var(--color-ocean);
  cursor: pointer;
  min-height: 44px;
}

.btn-primary:hover {
  background-color: var(--color-ocean-dark);
  color: #fff;
}

.btn-outline {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background-color: transparent;
  color: var(--color-charcoal);
  border: 1px solid var(--color-charcoal);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: var(--radius);
  cursor: pointer;
  min-height: 44px;
}

.btn-outline:hover {
  background-color: var(--color-charcoal);
  color: var(--color-ivory);
}

/* Tables */
.table-wrap {
  overflow-x: auto;
  margin: 1.5rem 0;
  background: var(--color-ivory);
  border-radius: var(--radius);
  box-shadow: 0 1px 4px var(--color-shadow);
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.95rem;
  min-width: 550px;
}

caption {
  font-family: var(--font-serif);
  font-weight: 700;
  text-align: left;
  padding: 1rem;
  background: var(--color-sand);
  border-bottom: 1px solid var(--color-border);
}

th, td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--color-border);
  vertical-align: top;
}

th {
  background-color: #ede2cf;
  font-weight: 600;
}

tbody tr:last-child td {
  border-bottom: none;
}

/* Definition lists and ordered lists */
dl.terms-list {
  margin: 1.5rem 0;
}

dl.terms-list dt {
  font-weight: 700;
  font-family: var(--font-serif);
  font-size: 1.1rem;
  margin-top: 1rem;
  color: var(--color-ocean-dark);
}

dl.terms-list dd {
  margin-left: 0;
  margin-bottom: 0.75rem;
  color: #3e3e3e;
}

ol.step-list {
  padding-left: 1.4rem;
  margin: 1.25rem 0;
}

ol.step-list li {
  margin-bottom: 0.85rem;
}

ul.bullet-list {
  padding-left: 1.4rem;
  margin: 1rem 0;
}

ul.bullet-list li {
  margin-bottom: 0.5rem;
}

/* Images */
.content-image {
  width: 100%;
  height: auto;
  max-height: 400px;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: 0 2px 8px var(--color-shadow);
  margin: 1.5rem 0;
  display: block;
}

/* FAQ Details */
details.faq-item {
  background-color: var(--color-ivory);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  margin-bottom: 1rem;
  padding: 0.75rem 1.25rem;
}

details.faq-item summary {
  font-weight: 600;
  font-family: var(--font-serif);
  cursor: pointer;
  padding: 0.5rem 0;
  font-size: 1.1rem;
  color: var(--color-charcoal);
  min-height: 44px;
  display: flex;
  align-items: center;
}

details.faq-item summary:hover {
  color: var(--color-ocean);
}

details.faq-item p {
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
  color: #3e3e3e;
}

/* Forms */
.form-group {
  margin-bottom: 1.25rem;
}

label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.4rem;
  font-size: 0.95rem;
}

input[type="text"],
input[type="url"],
select,
textarea {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background-color: #fff;
  font-family: inherit;
  font-size: 1rem;
  color: var(--color-charcoal);
}

textarea {
  resize: vertical;
  min-height: 120px;
}

.readonly-output {
  background-color: #f7f3ea;
  border: 1px solid var(--color-border);
  font-family: monospace;
  font-size: 0.9rem;
}

.field-error {
  color: #b00020;
  font-size: 0.875rem;
  margin-top: 0.25rem;
  display: block;
}

.button-row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.status-message {
  padding: 0.5rem;
  margin-top: 0.75rem;
  font-weight: 600;
  color: var(--color-ocean-dark);
}

/* Cross links */
.related-box {
  margin-top: 3rem;
  padding: 1.5rem;
  background-color: #eee3cf;
  border-radius: var(--radius);
}

.related-box h3 {
  margin-top: 0;
}

.related-box ul {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 0 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Footer */
.site-footer {
  background-color: var(--color-charcoal);
  color: #dedede;
  padding: 3rem 1.25rem 2rem 1.25rem;
  margin-top: auto;
  font-size: 0.9rem;
}

.footer-container {
  max-width: var(--max-width);
  margin: 0 auto;
}

.footer-top {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid #444;
  padding-bottom: 2rem;
}

.footer-brand {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-ivory);
  margin-bottom: 0.5rem;
  display: inline-block;
  text-decoration: none;
}

.footer-desc {
  line-height: 1.5;
  color: #bbb;
  margin-bottom: 0.75rem;
}

.footer-nav h4 {
  color: var(--color-ivory);
  font-size: 1rem;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid #555;
  padding-bottom: 0.25rem;
}

.footer-nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-nav li {
  margin-bottom: 0.4rem;
}

.footer-nav a {
  color: #ccc;
  text-decoration: none;
}

.footer-nav a:hover {
  color: #fff;
  text-decoration: underline;
}

.footer-bottom {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: #999;
}

.footer-bottom a {
  color: #bbb;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Responsive adjustments */
@media (max-width: 860px) {
  .nav-desktop {
    display: none;
  }

  .menu-toggle {
    display: flex;
  }

  .mobile-nav-panel:not([hidden]) {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    position: absolute;
    top: 100%;
    right: 0.75rem;
    left: auto;
    width: 250px;
    max-width: calc(100vw - 1.5rem);
    background: var(--color-ivory);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1rem 1.15rem;
    box-shadow: 0 8px 24px var(--color-shadow-hover);
    z-index: 1000;
  }

  .mobile-nav-panel ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
  }

  .mobile-nav-panel a {
    text-decoration: none;
    font-size: 0.95rem;
    color: var(--color-charcoal);
    font-weight: 500;
    display: block;
    padding: 0.35rem 0;
  }

  .mobile-nav-panel a:hover {
    color: var(--color-ocean);
  }

  .mobile-nav-panel .btn-header {
    text-align: center;
    margin-top: 0.25rem;
    padding: 0.45rem 0.75rem;
    font-size: 0.75rem;
  }

  .footer-top {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}