@import url("https://api.fonts.coollabs.io/css2?family=Cormorant+Garamond:ital,wght@0,300..700;1,300..700&family=Mona+Sans:ital,wght@0,200..900;1,200..900&family=Young+Serif&display=swap");

/* ==========================================================================
   Tokens
   ========================================================================== */
:root {
  --secondary-color: #764b36;
  --tertiary-color: #efe7dd;
  --surface-color: #f8f3ec;
  --error-color: #a3321f;

  --font-display: "Cormorant Garamond", Georgia, serif;
  --font-heading: "Young Serif", Georgia, serif;
  --font-ui:
    Arial, Helvetica, sans-serif; /* links, nav, form (as originally) */

  /* One spacing scale used everywhere */
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2.5rem;
  --space-5: clamp(3rem, 8vw, 8rem); /* gap between page sections */

  --gutter: clamp(1.25rem, 5vw, 2rem); /* page edge padding */
  --content-width: 85vw;
  --radius: 0.25rem;
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background-color: var(--tertiary-color);
  color: var(--secondary-color);
}

main {
  flex: 1;
}

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

a {
  color: var(--tertiary-color);
  font-family: var(--font-ui);
  text-decoration: none;
}

h1,
h2 {
  margin: 0;
}

h1 {
  font-family: var(--font-display);
  color: var(--secondary-color);
}

h2 {
  font-family: var(--font-heading);
  font-weight: 400;
  font-style: normal;
  color: var(--tertiary-color);
}

ul {
  margin: 0;
  padding: 0;
  list-style-type: none;
}

:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

/* ==========================================================================
   Layout helpers
   ========================================================================== */
.container {
  width: min(100% - 2 * var(--gutter), var(--content-width));
  margin-inline: auto;
}

.section-margin {
  margin-bottom: var(--space-5);
}

/* ==========================================================================
   Header / navigation
   ========================================================================== */
header {
  padding-block: var(--space-2);
}

nav {
  display: flex;
}

.nav-list {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.nav-scribble {
  width: 3rem;
  height: auto;
}

.nav-list > ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--space-1) var(--space-4);
}

.nav-list > ul > li > a {
  color: var(--secondary-color);
  padding-block: 0.25rem;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}

.nav-list > ul > li > a:hover,
.nav-list > ul > li > a[aria-current="page"] {
  border-bottom-color: currentColor;
}

/* ==========================================================================
   Hero (home page)
   ========================================================================== */
.hero-parallax {
  display: flex;
  min-height: min(93vh, 56rem);
  padding: var(--space-4) var(--gutter);
  background-image:
    linear-gradient(rgb(0 0 0 / 0.2), rgb(0 0 0 / 0.2)), url("./hero.png");
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

/* Fixed backgrounds are janky on touch devices; only use on desktop */
@media (min-width: 1025px) and (hover: hover) {
  .hero-parallax {
    background-attachment: fixed;
  }
}

.hero-text {
  display: flex;
  flex-direction: column;
  margin: auto;
  color: white;
  text-align: center;
}

.hero-text > h1 {
  font-family: var(--font-display);
  font-size: clamp(3.25rem, 12vw, 8rem);
  font-weight: normal;
  line-height: 1;
  color: white;
}

.hero-text > h2 {
  font-family: "Mona Sans", sans-serif;
  font-size: clamp(1.5rem, 6vw, 3.75rem);
  letter-spacing: clamp(0.25rem, 1.2vw, 0.85rem);
  color: white;
}

/* ==========================================================================
   Image + text sections (home, about)
   ========================================================================== */
.image-section {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  align-items: center;
  gap: var(--space-4);
}

.image-section > img {
  width: 100%;
}

.description > * {
  max-width: 36rem;
}

.description > p {
  /* margin: 0; */
  line-height: 2;
}

.description > .button {
  display: inline-block;
  margin-top: var(--space-3);
  text-align: center;
  text-decoration: none;
}

.name {
  margin-bottom: 0;
  font-size: clamp(2.25rem, 5vw, 3.5rem);
  line-height: 1;
}

.title {
  margin: var(--space-1) 0 var(--space-3);
}

/* Mirrored section: image left, text right-aligned */
.reverse {
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
}

.reverse > .description {
  order: 2;
  text-align: justify;
}

.reverse > .description > * {
  margin-left: auto;
}

/* ==========================================================================
   Contact page
   ========================================================================== */
.contact-section {
  max-width: 40rem;
}

.contact-section > .description {
  margin-bottom: var(--space-4);
  text-align: center;
}

.contact-section > .description > * {
  max-width: none;
}

.contact-form {
  display: grid;
  gap: var(--space-3);
}

.field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
}

.field {
  display: grid;
  gap: var(--space-1);
}

.field label {
  font-family: var(--font-ui);
  font-size: 0.95rem;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 0.75rem 0.875rem;
  font-family: var(--font-ui);
  font-size: 1rem; /* 16px prevents zoom on iOS focus */
  color: var(--secondary-color);
  background: var(--tertiary-color);
  border: 1px solid rgb(118 75 54 / 0.5);
  border-radius: var(--radius);
}

.field textarea {
  min-height: 9rem;
  resize: vertical;
}

.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible {
  outline: 2px solid var(--secondary-color);
  outline-offset: 2px;
  background: white;
}

.field.invalid input,
.field.invalid select,
.field.invalid textarea {
  border-color: var(--error-color);
}

.field-error {
  min-height: 1.25rem;
  margin: 0;
  font-family: var(--font-ui);
  font-size: 0.875rem;
  color: var(--error-color);
}

.button {
  justify-self: start;
  padding: 0.875rem 2rem;
  font-family: var(--font-ui);
  font-size: 1rem;
  color: var(--tertiary-color);
  background: var(--secondary-color);
  border: 1px solid var(--secondary-color);
  border-radius: var(--radius);
  cursor: pointer;
  transition:
    background-color 0.2s,
    color 0.2s;
}

.button:hover {
  background: transparent;
  color: var(--secondary-color);
}

.button:disabled {
  opacity: 0.6;
  cursor: wait;
}

.form-status {
  margin: 0;
  font-family: var(--font-ui);
  min-height: 1.5rem;
}

.form-status.success {
  font-weight: 500;
}

.form-status.error {
  color: var(--error-color);
}

/* ==========================================================================
   Footer
   ========================================================================== */
footer {
  margin-top: auto;
  padding-block: var(--space-4);
  background: var(--secondary-color);
  color: var(--tertiary-color);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-4) var(--space-3);
}

.footer-grid ul {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.footer-grid h2 {
  margin-bottom: var(--space-1);
  font-size: 1.25rem;
}

.footer-grid p {
  margin: 0;
}

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

.footer-stamp-image {
  display: block;
  width: 8rem;
  height: 8rem;
}

/* ==========================================================================
   Scroll fade (only hides content when JS is running)
   ========================================================================== */
.js .fade {
  opacity: 0;
  transition: opacity 1s;
}

.js .fade.visible {
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .js .fade {
    opacity: 1;
    transition: none;
  }
}

/* ==========================================================================
   Tablet
   ========================================================================== */
@media (max-width: 900px) {
  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ==========================================================================
   Mobile
   ========================================================================== */
@media (max-width: 760px) {
  .image-section,
  .reverse {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-3);
  }

  /* Text always sits above the image when stacked */
  .reverse > .description {
    order: 0;
    text-align: left;
  }

  .reverse > .description > * {
    margin-left: 0;
  }

  .description > * {
    max-width: none;
  }

  .field-row {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-3);
  }

  .button {
    justify-self: stretch;
  }
}

@media (max-width: 560px) {
  .nav-list > ul {
    gap: var(--space-1) var(--space-3);
  }

  .footer-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ==========================================================================
   Legal pages (terms, privacy)
   ========================================================================== */
.legal-intro {
  max-width: 46rem;
  margin-bottom: var(--space-4);
}

.legal-intro .lead {
  margin: 0;
  font-size: 1.25rem;
  line-height: 1.8;
}

.legal-intro .updated {
  margin: var(--space-2) 0 0;
  font-family: var(--font-ui);
  font-size: 0.875rem;
  opacity: 0.8;
}

.legal-summary {
  margin-bottom: var(--space-4);
  padding: clamp(1.25rem, 4vw, 2.5rem);
  background: var(--surface-color);
  border: 1px solid rgb(118 75 54 / 0.25);
  border-radius: var(--radius);
}

.legal-summary h2,
.legal-item h2 {
  font-size: clamp(1.25rem, 2.2vw, 1.5rem);
  line-height: 1.3;
  color: var(--secondary-color);
}

.legal-summary h2 {
  margin-bottom: var(--space-2);
}

.legal-summary ul {
  display: grid;
  gap: var(--space-1);
  padding-left: 1.25rem;
  list-style-type: disc;
  font-size: 1.125rem;
  line-height: 1.6;
}

/* Each topic: short heading on the left, text on the right */
.legal-item {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  gap: var(--space-2) var(--space-4);
  padding-block: var(--space-4);
  border-top: 1px solid rgb(118 75 54 / 0.25);
}

.legal-item:last-of-type {
  border-bottom: 1px solid rgb(118 75 54 / 0.25);
}

.legal-body {
  max-width: 40rem;
  font-size: 1.125rem;
  line-height: 1.8;
}

.legal-body > * {
  margin: 0 0 var(--space-2);
}

.legal-body > :last-child {
  margin-bottom: 0;
}

.legal-body ul {
  padding-left: 1.25rem;
  list-style-type: disc;
}

.legal-body li + li {
  margin-top: 0.35rem;
}

.legal-body a,
.legal-footnote a {
  color: var(--secondary-color);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.legal-footnote {
  max-width: 46rem;
  margin: var(--space-4) 0 0;
  font-size: 1.125rem;
  line-height: 1.8;
}

@media (max-width: 760px) {
  .legal-item {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-1);
    padding-block: var(--space-3);
  }
}
