/* Alma Spirit Inspired: the design system.
   Alma's Sand ground, Dark Dirt and near-black ink, the clay red of the
   al ma mark. One spacing scale, one control radius, one section rhythm. */

:root {
  color-scheme: light;
  --bg: #ede8d8;
  --bg-raise: #f5f1e4;
  --bg-sink: #e2dcc8;
  --line: rgba(36, 33, 33, 0.14);
  --line-strong: rgba(36, 33, 33, 0.3);
  --fg: #242121;
  --fg-soft: #3b3330;
  --muted: #77624c;
  /* Brand Brick, straight from the guidelines. */
  --red: #b24a3b;
  --red-deep: #8d382c;
  --ember: #a8724a;
  --glow: rgba(178, 74, 59, 0.1);
  /* Alma's brand typography. The guidelines name Cousine for headers and
     True Typewriter for body. Cousine is served as a webfont; True Typewriter
     is a desktop licence, so body sits in Courier Prime — the same typewriter
     skeleton, drawn for screen reading. Every fallback is a monospace with
     Courier metrics, so the page holds its shape even if the webfonts are
     slow or blocked. --serif and --sans keep their old names so every rule
     that already calls them inherits the brand faces. */
  --header: "Cousine", ui-monospace, "Courier New", Courier, monospace;
  --body: "Courier Prime", "Cousine", ui-monospace, "Courier New", Courier, monospace;
  --serif: var(--header);
  --sans: var(--body);
  --mustard: #f8b935;
  --clay: #ab8e69;
  --s1: 0.25rem;
  --s2: 0.5rem;
  --s3: 0.75rem;
  --s4: 1rem;
  --s5: 1.5rem;
  --s6: 2rem;
  --s7: 3rem;
  --s8: 4.5rem;
  --s9: 6.5rem;
  --gutter: clamp(var(--s5), 4vw, var(--s8));
  --radius: 4px;
  --maxw: 74rem;
  --measure: 60ch;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

html {
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}

/* The scroll shell: the document never scrolls. Content scrolls inside
   #siteScroll and the header stays outside it, stable on every surface. */
body {
  margin: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--fg-soft);
  font-family: var(--body);
  font-size: 1rem;
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
}

#siteScroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

::selection {
  background: var(--red-deep);
  color: var(--fg);
}

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

a {
  color: var(--fg);
}

:focus-visible {
  outline: 2px solid var(--ember);
  outline-offset: 3px;
}

h1,
h2,
h3,
h4 {
  font-family: var(--header);
  font-weight: 400;
  color: var(--fg);
  margin: 0;
  letter-spacing: -0.005em;
  line-height: 1.22;
}

h2 {
  font-size: clamp(1.5rem, 2.6vw, 2.1rem);
  letter-spacing: -0.015em;
}

h3 {
  font-size: 1.2rem;
}

p {
  margin: 0;
}

p + p {
  margin-top: var(--s4);
}

.skip-link {
  position: absolute;
  left: -999rem;
  top: var(--s4);
}

.skip-link:focus {
  left: var(--s4);
  z-index: 20;
  background: var(--bg-raise);
  color: var(--fg);
  padding: var(--s2) var(--s3);
  border-radius: var(--radius);
}

/* ---- Header: outside the scroller, condenses on scroll ---- */

.site-header {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s5);
  padding: var(--s5) var(--gutter);
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  transition: padding 0.35s var(--ease);
}

.site-header[data-condensed] {
  padding-block: var(--s3);
}

.brand {
  display: inline-block;
  line-height: 0;
  border-radius: var(--radius);
}

.brand-mark {
  height: 3.5rem;
  width: auto;
  transition: height 0.35s var(--ease);
}

.site-header[data-condensed] .brand-mark {
  height: 2.5rem;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(var(--s4), 2.2vw, var(--s6));
}

.site-link {
  color: var(--fg-soft);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: var(--s1) 0;
  border-bottom: 1px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}

.site-link:hover {
  color: var(--fg);
}

.site-link[aria-current="page"] {
  color: var(--fg);
  border-bottom-color: var(--red);
}

.menu-button {
  display: none;
  align-items: center;
  font: 500 0.8rem var(--sans);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg);
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: var(--s2) var(--s4);
  cursor: pointer;
}

@media (max-width: 900px) {
  .menu-button {
    display: inline-flex;
  }

  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    padding: var(--s2) var(--gutter) var(--s5);
  }

  .site-header[data-menu="open"] .site-nav {
    display: flex;
  }

  .site-link {
    font-size: 0.95rem;
    padding: var(--s3) 0;
    border-bottom: 1px solid var(--line);
  }

  .site-link[aria-current="page"] {
    color: var(--ember);
    border-bottom-color: var(--line);
  }
}

/* ---- Layout and rhythm ---- */

.wrap {
  width: min(100% - 2 * var(--gutter), var(--maxw));
  margin-inline: auto;
}

.section {
  padding-block: clamp(var(--s7), 8vw, var(--s9));
}

.section + .section {
  border-top: 1px solid var(--line);
}

.section-raise {
  background: var(--bg-raise);
}

.section-head {
  max-width: var(--measure);
  margin-bottom: var(--s6);
}

.section-head + .prose {
  margin-top: calc(var(--s6) * -1 + var(--s4));
}

/* Subheadlines, per the guidelines: header font, uppercase, open tracking.
   Monospace is already wide, so the tracking is eased back from 0.2em. */
.eyebrow {
  font-family: var(--header);
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: var(--s4);
}

.display {
  font-size: clamp(2.1rem, 4.6vw, 3.5rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
}

.title {
  font-size: clamp(1.9rem, 3.8vw, 2.9rem);
  line-height: 1.14;
  letter-spacing: -0.02em;
}

.lede {
  font-family: var(--body);
  font-size: clamp(1.05rem, 1.5vw, 1.2rem);
  line-height: 1.6;
  color: var(--fg);
  margin-top: var(--s5);
  max-width: 40ch;
}

.sub {
  font-family: var(--header);
  font-size: 1.15rem;
  line-height: 1.45;
  color: var(--fg);
  margin-top: var(--s4);
}

.motto {
  font-family: var(--body);
  font-style: italic;
  font-size: 1.05rem;
  color: var(--ember);
  margin-top: var(--s5);
}

.prose {
  max-width: var(--measure);
}

.prose + .prose,
.prose + .actions,
.prose + .rows,
.prose + .note {
  margin-top: var(--s5);
}

.prose-lg p {
  font-family: var(--serif);
  font-size: clamp(1.15rem, 1.6vw, 1.4rem);
  line-height: 1.5;
  color: var(--fg);
}

.prose-lg p + p {
  margin-top: var(--s5);
}

.prose-center {
  max-width: 58ch;
  margin-inline: auto;
  text-align: center;
}

.prose-center h2 {
  margin-bottom: var(--s5);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s3);
  margin-top: var(--s6);
}

.note {
  color: var(--muted);
  font-size: 0.95rem;
  border-left: 2px solid var(--line-strong);
  padding-left: var(--s4);
  max-width: var(--measure);
}

.deadline {
  font-family: var(--serif);
  font-size: 1.2rem;
  color: var(--ember);
  margin-top: var(--s5);
}

/* ---- Controls: one radius ---- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  padding: 0.85rem 1.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--fg);
  font: 500 0.9rem var(--sans);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.25s, border-color 0.25s, color 0.25s;
}

.button:hover {
  border-color: var(--fg-soft);
}

.button-primary {
  background: var(--red);
  border-color: var(--red);
  color: #fff8f2;
}

.button-primary:hover {
  background: var(--red-deep);
  border-color: var(--red-deep);
}

.text-link {
  color: var(--ember);
  text-decoration: none;
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border-bottom: 1px solid currentColor;
  padding-bottom: 2px;
}

.text-link:hover {
  color: var(--fg);
}

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

.hero {
  position: relative;
  overflow: hidden;
  padding-block: clamp(var(--s7), 9vw, var(--s9));
}

.hero::before {
  content: "";
  position: absolute;
  left: -10%;
  right: -10%;
  bottom: -30%;
  height: 70%;
  background: radial-gradient(60% 60% at 50% 100%, var(--glow), transparent 70%);
  pointer-events: none;
  opacity: 0.7;
}

[data-arrived] .hero::before {
  animation: candle 7s ease-in-out infinite alternate;
}

@keyframes candle {
  from {
    opacity: 0.5;
  }
  to {
    opacity: 1;
  }
}

.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(var(--s6), 5vw, var(--s9));
  align-items: center;
}

/* On Visit the heading sits level with the top of the artwork rather than
   floating in the middle of the row. */
.route-visit .hero-grid {
  align-items: start;
}

.figure {
  margin: 0;
}

.figure img {
  width: 100%;
  object-fit: cover;
  border-radius: var(--radius);
  background: var(--bg-raise);
}

.hero-figure img {
  aspect-ratio: 4 / 5;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(var(--s6), 5vw, var(--s9));
  align-items: center;
}

.split-figure img {
  aspect-ratio: 4 / 5;
}

.split-copy .prose {
  margin-top: var(--s5);
}

.banner-figure img {
  aspect-ratio: 16 / 7;
}

@media (max-width: 900px) {
  .hero-grid,
  .split {
    grid-template-columns: 1fr;
  }

  .hero-figure {
    order: -1;
  }

  .hero-figure img,
  .split-figure img {
    aspect-ratio: 4 / 3;
  }
}

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

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: var(--s5);
}

.card {
  display: flex;
  flex-direction: column;
  gap: var(--s3);
  padding: var(--s6);
  background: var(--bg-raise);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.section-raise .card {
  background: var(--bg);
}

.card-heading {
  font-size: 1.55rem;
}

.card-meta {
  color: var(--muted);
  font-size: 0.95rem;
}

.card .text-link {
  margin-top: auto;
  align-self: flex-start;
  padding-top: var(--s3);
}

.card .actions {
  margin-top: auto;
  padding-top: var(--s3);
}

/* ---- Rows (hours, facts) ---- */

.rows {
  display: grid;
  border-top: 1px solid var(--line);
}

.row {
  display: grid;
  grid-template-columns: minmax(0, 14rem) minmax(0, 1fr);
  gap: var(--s4);
  padding-block: var(--s4);
  border-bottom: 1px solid var(--line);
}

.row-key {
  font-family: var(--serif);
  font-size: 1.2rem;
  color: var(--fg);
}

.row-value {
  color: var(--fg-soft);
}

@media (max-width: 600px) {
  .row {
    grid-template-columns: 1fr;
    gap: var(--s1);
  }
}

/* ---- Menu ---- */

.menu-layout {
  display: grid;
  grid-template-columns: minmax(0, 16rem) minmax(0, 1fr);
  gap: clamp(var(--s6), 6vw, var(--s9));
  align-items: start;
}

.menu-side {
  position: relative;
}

.menu-mark img {
  max-width: 9rem;
  border-radius: 0;
}

.menu-group + .menu-group {
  margin-top: var(--s7);
}

.menu-heading {
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ember);
  margin-bottom: var(--s3);
}

.menu-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}

.menu-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--s4);
  padding-block: var(--s3);
  border-bottom: 1px solid var(--line);
}

.menu-name {
  font-family: var(--serif);
  font-size: 1.2rem;
  color: var(--fg);
}

.menu-price {
  font-variant-numeric: tabular-nums;
  color: var(--fg-soft);
  flex: none;
}

@media (max-width: 900px) {
  .menu-layout {
    grid-template-columns: 1fr;
  }
}

/* ---- Events ---- */

.events {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
  gap: var(--s5);
}

.event {
  display: flex;
  flex-direction: column;
  gap: var(--s3);
  padding: var(--s5);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-raise);
}

.event-figure img {
  aspect-ratio: 4 / 5;
}

.event-when {
  font-family: var(--serif);
  font-size: 1.15rem;
  color: var(--ember);
}

.event .note {
  margin-top: auto;
}

/* ---- Experiences ---- */

.experience {
  display: grid;
  grid-template-columns: minmax(0, 18rem) minmax(0, 1fr);
  gap: clamp(var(--s5), 4vw, var(--s8));
  padding-block: var(--s7);
  border-top: 1px solid var(--line);
}

.experience:last-child {
  border-bottom: 1px solid var(--line);
}

.experience-heading {
  font-size: clamp(1.6rem, 2.6vw, 2.2rem);
}

.experience-meta {
  color: var(--ember);
  font-family: var(--serif);
  font-size: 1.1rem;
  margin-top: var(--s4);
}

.experience .actions {
  margin-top: var(--s5);
}

@media (max-width: 900px) {
  .experience {
    grid-template-columns: 1fr;
    gap: var(--s4);
  }
}

/* ---- Forms and native embeds ---- */

.form-panel {
  padding: clamp(var(--s5), 3vw, var(--s7));
  background: var(--bg-raise);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.section-raise .form-panel {
  background: var(--bg);
}

.form-panel h2 {
  margin-bottom: var(--s5);
}

.form-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  gap: clamp(var(--s6), 5vw, var(--s9));
  align-items: start;
}

@media (max-width: 900px) {
  .form-layout {
    grid-template-columns: 1fr;
  }
}

.embed {
  min-height: 2rem;
}

.cloud-form {
  display: grid;
  gap: var(--s5);
}

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

.field-label {
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.field-input {
  width: 100%;
  font: inherit;
  color: var(--fg);
  background: var(--bg-sink);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 0.8rem 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.field-input::placeholder {
  color: var(--muted);
}

.field-input:focus {
  outline: none;
  border-color: var(--ember);
  box-shadow: 0 0 0 3px var(--glow);
}

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

select.field-input {
  appearance: none;
  -webkit-appearance: none;
}

input[type="checkbox"].field-input,
input[type="radio"].field-input {
  width: auto;
  accent-color: var(--red);
}

.field-note {
  color: var(--muted);
  font-size: 0.95rem;
}

.shop-table {
  min-height: 4rem;
}

.shop-empty {
  margin-top: var(--s5);
}

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

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--bg-sink);
  padding-block: clamp(var(--s7), 6vw, var(--s8)) var(--s6);
  color: var(--muted);
  font-size: 0.95rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: var(--s6);
}

.footer-mark {
  display: inline-block;
  line-height: 0;
}

.footer-mark img {
  height: 2.5rem;
  width: auto;
}

.footer-tagline {
  font-family: var(--serif);
  font-size: 1.1rem;
  color: var(--fg-soft);
  margin-top: var(--s4);
}

.footer-heading {
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-soft);
  margin-bottom: var(--s3);
}

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

.site-footer a:hover {
  color: var(--fg);
}

.site-footer p + p {
  margin-top: var(--s2);
}

.footer-nav {
  display: grid;
  gap: var(--s2);
  align-content: start;
}

.footer-base {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: var(--s4);
  margin-top: var(--s7);
  padding-top: var(--s5);
  border-top: 1px solid var(--line);
  font-size: 0.85rem;
}

.footer-name {
  color: var(--muted);
}

.footer-credit {
  font-size: 0.85rem;
  color: var(--muted);
}

/* ---- Route entrance (client-side navigations only) ---- */

.route[data-animate] {
  animation: route-in 0.5s var(--ease) both;
}

@keyframes route-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.not-found {
  padding-block: var(--s9);
  text-align: center;
}

@media (prefers-reduced-motion: reduce) {
  .route[data-animate],
  [data-arrived] .hero::before {
    animation: none;
  }

  .site-header,
  .brand-mark,
  .button,
  .site-link {
    transition: none;
  }
}

/* ---- The mark on the home page ----
   Alma's own device, the one on the tote and in the guidelines: the wordmark
   standing in front of an imperfect sun. The sun is drawn in CSS — an off-round
   blob in Mustard with a soft ember halo — so it can breathe slowly without a
   second image. The wordmark itself is the brand asset, untouched. */

.brand-stage {
  position: relative;
  display: block;
  width: fit-content;
  max-width: 100%;
  margin-bottom: var(--s6);
  isolation: isolate;
}

.brand-sun {
  position: absolute;
  z-index: 0;
  left: 2%;
  top: 50%;
  width: clamp(8rem, 15vw, 12rem);
  aspect-ratio: 1;
  transform: translateY(-58%);
  background: var(--mustard);
  /* An imperfect circle: the brand's sun is drawn by hand, not compassed. */
  border-radius: 56% 44% 49% 51% / 47% 53% 47% 53%;
  opacity: 0.95;
  pointer-events: none;
}

.brand-sun::after {
  content: "";
  position: absolute;
  inset: -38%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(248, 185, 53, 0.4), transparent 72%);
}

/* The wordmark is carried as a mask rather than a flat picture, so it takes
   its colour from the page and stays exact at any size. */
.brand-lockup {
  position: relative;
  z-index: 1;
  display: block;
  width: clamp(14rem, 27vw, 21rem);
  aspect-ratio: 560 / 443;
  background-color: var(--red);
  /* The mark is stored as a luminance mask — white letterforms on black — so
     it has to be read by brightness, not by alpha. Without mask-mode the
     browser reads the (fully opaque) alpha channel and paints a solid block. */
  -webkit-mask-source-type: luminance;
  mask-mode: luminance;
  -webkit-mask-image: url("/_next/image?url=https%3A%2F%2Flovable-crab-328.convex.cloud%2Fapi%2Fstorage%2F1bd799a7-9e5a-4385-8660-6741e4469082&w=1920&q=75");
  mask-image: url("/_next/image?url=https%3A%2F%2Flovable-crab-328.convex.cloud%2Fapi%2Fstorage%2F1bd799a7-9e5a-4385-8660-6741e4469082&w=1920&q=75");
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
}

[data-arrived] .brand-sun {
  animation: sunrise 9s ease-in-out infinite alternate;
}

@keyframes sunrise {
  from {
    transform: translateY(-54%) scale(0.97);
    opacity: 0.82;
  }
  to {
    transform: translateY(-61%) scale(1.03);
    opacity: 1;
  }
}

@media (max-width: 900px) {
  .brand-stage {
    margin-inline: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  [data-arrived] .brand-sun {
    animation: none;
  }
}

/* ---- The September invitation pages ----
   These stand in for a printed card, so the page is one centred column with
   the mark at the top, the date set large, and nothing competing with it. */

.gathering-card {
  max-width: 44rem;
  margin-inline: auto;
  text-align: center;
}

.brand-stage-small {
  margin-inline: auto;
  margin-bottom: var(--s7);
}

.brand-stage-small .brand-lockup {
  width: clamp(11rem, 22vw, 15rem);
}

.brand-stage-small .brand-sun {
  width: clamp(6rem, 12vw, 8.5rem);
}

.gathering-when {
  font-family: var(--header);
  font-size: clamp(1.6rem, 3.4vw, 2.4rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--red);
  margin-top: var(--s4);
}

.gathering-doors {
  font-family: var(--body);
  font-size: 1.05rem;
  color: var(--muted);
  margin-top: var(--s2);
}

.gathering-card .lede {
  max-width: none;
  margin-inline: auto;
  margin-top: var(--s6);
}

.gathering-card .prose {
  max-width: 58ch;
  margin-inline: auto;
  margin-top: var(--s5);
}

.gathering-card .actions {
  justify-content: center;
  margin-top: var(--s6);
}

.gathering-sub {
  margin-top: var(--s6);
}

@media (max-width: 700px) {
  .gathering-card {
    text-align: left;
  }

  .gathering-card .actions {
    justify-content: flex-start;
  }
}
