/* ==========================================================================
   EVENTRA - core design system
   Warm editorial minimalism. Instrument Serif, Inter, burnt orange.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design tokens
   -------------------------------------------------------------------------- */
:root {
  color-scheme: light;

  --bg: #f7f4ee;
  --bg-elevated: #fcfaf5;
  --surface: #efeae1;
  --surface-strong: #e7e0d4;

  --text: #191714;
  --text-soft: #514b43;
  --muted: #7b746a;

  --line: rgba(25, 23, 20, 0.14);
  --line-strong: rgba(25, 23, 20, 0.26);

  --accent: #b84211;
  --accent-hover: #953309;
  --accent-ink: #9e3a10;
  --accent-soft: #f1e0d2;
  --accent-contrast: #fffaf4;

  --success: #2b6a45;
  --danger: #a62b21;

  --shadow-sm: 0 10px 30px rgba(25, 23, 20, 0.08);
  --shadow-lg: 0 30px 90px rgba(20, 17, 13, 0.22);

  --font-serif: "Instrument Serif", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;

  --container: 78rem;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --header-height: 4.875rem;
  --section-space: clamp(4.5rem, 9vw, 8.5rem);
  --radius: 2px;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="dark"] {
  color-scheme: dark;

  --bg: #141311;
  --bg-elevated: #1b1917;
  --surface: #201e1b;
  --surface-strong: #282521;

  --text: #f3efe7;
  --text-soft: #c9c3b8;
  --muted: #9b9489;

  --line: rgba(243, 239, 231, 0.13);
  --line-strong: rgba(243, 239, 231, 0.25);

  --accent: #ff6a33;
  --accent-hover: #ff8458;
  --accent-ink: #ff8a60;
  --accent-soft: #3a2418;
  --accent-contrast: #1b0c05;

  --success: #86c79f;
  --danger: #ff9b91;

  --shadow-sm: 0 10px 30px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 30px 90px rgba(0, 0, 0, 0.5);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 1.25rem);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-width: 20rem;
  overflow-x: clip;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.65;
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body.is-modal-open,
body.is-nav-open {
  overflow: hidden;
}

main {
  display: block;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 400;
  letter-spacing: -0.018em;
  line-height: 1.05;
  text-wrap: balance;
}

h1 em,
h2 em,
h3 em {
  font-style: italic;
}

p {
  margin: 0;
}

ul,
ol,
dl,
dd {
  margin: 0;
  padding: 0;
}

ul,
ol {
  list-style: none;
}

img,
svg {
  display: block;
}

img {
  max-width: 100%;
}

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

button {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

input,
select,
textarea {
  font: inherit;
  color: inherit;
}

fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}

address {
  font-style: normal;
}

::selection {
  background: var(--accent);
  color: var(--accent-contrast);
}

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

[hidden] {
  display: none !important;
}

.icon {
  width: 1rem;
  height: 1rem;
  flex: 0 0 auto;
}

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

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 2000;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  background: var(--text);
  color: var(--bg);
  font-size: 0.8125rem;
  font-weight: 600;
  transform: translateY(-200%);
  transition: transform 0.2s var(--ease);
}

.skip-link:focus {
  transform: translateY(0);
}

.nojs-note {
  padding: 0.85rem var(--gutter);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  color: var(--text-soft);
  text-align: center;
  font-size: 0.8125rem;
}

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

/* --------------------------------------------------------------------------
   3. Shared type and interface atoms
   -------------------------------------------------------------------------- */
.eyebrow {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin: 0 0 1.1rem;
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.17em;
  line-height: 1.3;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 1.75rem;
  height: 1px;
  flex: 0 0 auto;
  background: var(--accent);
}

.btn {
  display: inline-flex;
  min-height: 3rem;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  padding: 0.8rem 1.4rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.015em;
  line-height: 1.2;
  text-align: center;
  transition:
    background-color 0.25s var(--ease),
    border-color 0.25s var(--ease),
    color 0.25s var(--ease),
    transform 0.25s var(--ease);
}

.btn .icon {
  width: 1rem;
  height: 1rem;
  transition: transform 0.25s var(--ease);
}

.btn:hover .icon {
  transform: translateX(3px);
}

.btn--primary,
.btn-primary {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-contrast);
}

.btn--primary:hover,
.btn-primary:hover {
  border-color: var(--accent-hover);
  background: var(--accent-hover);
}

.btn--ghost,
.btn-ghost {
  border-color: var(--line-strong);
  background: transparent;
  color: var(--text);
}

.btn--ghost:hover,
.btn-ghost:hover {
  border-color: var(--text);
}

.btn--sm {
  min-height: 2.5rem;
  padding: 0.55rem 1.05rem;
  font-size: 0.75rem;
}

.btn--block,
.btn-block {
  width: 100%;
}

.btn:disabled,
.btn[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.5;
}

.btn:disabled:hover .icon,
.btn[aria-disabled="true"]:hover .icon {
  transform: none;
}

.link-underline {
  display: inline-flex;
  align-items: center;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid var(--line-strong);
  color: var(--text);
  font-size: 0.8125rem;
  font-weight: 500;
  transition: border-color 0.25s var(--ease), color 0.25s var(--ease);
}

.link-underline:hover {
  border-color: var(--accent);
  color: var(--accent-ink);
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding-bottom: 0.2rem;
  border: 0;
  border-bottom: 1px solid var(--line-strong);
  background: none;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  line-height: 1.4;
  text-transform: uppercase;
  transition: border-color 0.25s var(--ease), color 0.25s var(--ease);
}

.text-link .icon {
  width: 0.875rem;
  height: 0.875rem;
}

.text-link:hover {
  border-color: var(--accent);
  color: var(--accent-ink);
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.38rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.11em;
  line-height: 1.3;
  text-transform: uppercase;
}

.tag::before {
  content: "";
  width: 0.3rem;
  height: 0.3rem;
  flex: 0 0 auto;
  background: var(--accent);
}

.field-input {
  width: 100%;
  min-height: 3rem;
  padding: 0.72rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  font-size: 0.9375rem;
  line-height: 1.5;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

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

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

.field-input[aria-invalid="true"] {
  border-color: var(--danger);
}

.field-input[aria-invalid="true"]:focus {
  box-shadow: 0 0 0 3px rgba(166, 43, 33, 0.16);
}

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

.select-wrap {
  position: relative;
}

.select-wrap > .icon,
.select-wrap > svg {
  position: absolute;
  top: 50%;
  right: 0.85rem;
  width: 1rem;
  height: 1rem;
  color: var(--muted);
  pointer-events: none;
  transform: translateY(-50%);
}

select.field-input {
  appearance: none;
  padding-right: 2.5rem;
  cursor: pointer;
}

select option {
  background: var(--bg-elevated);
  color: var(--text);
}

.form-status {
  min-height: 1.5em;
  margin: 0.7rem 0 0;
  color: var(--success);
  font-size: 0.8125rem;
  line-height: 1.5;
}

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

/* --------------------------------------------------------------------------
   4. Header and mobile navigation
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid transparent;
  background: var(--bg);
  transition: border-color 0.3s var(--ease);
}

.site-header.is-scrolled {
  border-bottom-color: var(--line);
}

.header__inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 2rem;
  height: var(--header-height);
}

.brand {
  display: inline-flex;
  align-items: baseline;
  justify-self: start;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.21em;
  line-height: 1;
  white-space: nowrap;
}

.brand__dot {
  margin-left: 0.08em;
  color: var(--accent);
  font-size: 1.5em;
  line-height: 0;
}

.primary-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(1.5rem, 3vw, 2.75rem);
}

.nav-link {
  position: relative;
  display: inline-block;
  padding: 0.55rem 0;
  color: var(--text-soft);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.005em;
  transition: color 0.2s var(--ease);
}

.nav-link::after {
  content: "";
  position: absolute;
  right: 100%;
  bottom: 0.25rem;
  left: 0;
  height: 1px;
  background: var(--accent);
  transition: right 0.3s var(--ease);
}

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

.nav-link:hover::after,
.nav-link.is-active::after {
  right: 0;
}

.nav-link.is-active {
  color: var(--text);
}

.header__actions {
  display: flex;
  align-items: center;
  justify-self: end;
  gap: 0.4rem;
}

.icon-btn {
  display: inline-grid;
  width: 2.75rem;
  height: 2.75rem;
  place-items: center;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--text);
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease);
}

.icon-btn > svg,
.icon-btn > .icon {
  width: 1.125rem;
  height: 1.125rem;
}

.icon-btn:hover {
  background: var(--surface);
  color: var(--text);
}

.theme-toggle .icon--sun {
  display: none;
}

.theme-toggle .icon--moon {
  display: block;
}

[data-theme="dark"] .theme-toggle .icon--sun {
  display: block;
}

[data-theme="dark"] .theme-toggle .icon--moon {
  display: none;
}

.header__cta {
  margin-left: 0.2rem;
}

.nav-toggle {
  position: relative;
  display: none;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: var(--radius);
}

.nav-toggle span {
  position: absolute;
  top: 50%;
  left: 50%;
  display: block;
  width: 1.125rem;
  height: 1.5px;
  background: currentColor;
  transform: translate(-50%, calc(-50% - 3px));
  transition: transform 0.25s var(--ease);
}

.nav-toggle span:last-child {
  transform: translate(-50%, calc(-50% + 3px));
}

.nav-toggle[aria-expanded="true"] span:first-child {
  transform: translate(-50%, -50%) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:last-child {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.mobile-nav {
  display: none;
}

.mobile-nav__links {
  display: flex;
  flex-direction: column;
}

.mobile-nav__link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-serif);
  font-size: 1.9rem;
  line-height: 1.2;
}

.mobile-nav__link .icon {
  width: 1.1rem;
  height: 1.1rem;
  color: var(--accent-ink);
}

.mobile-nav__footer {
  display: grid;
  gap: 1.25rem;
  margin-top: 1.75rem;
}

.mobile-nav__footer p {
  color: var(--muted);
  font-family: var(--font-serif);
  font-size: 1.1rem;
  line-height: 1.35;
}

/* --------------------------------------------------------------------------
   5. Sections and shared section headings
   -------------------------------------------------------------------------- */
.section {
  padding-block: var(--section-space);
}

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

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: clamp(1.5rem, 4vw, 3.5rem);
  margin-bottom: clamp(2.5rem, 5vw, 4.25rem);
}

.section-head h2 {
  max-width: 18ch;
  margin-top: 0.75rem;
  font-size: clamp(2.5rem, 4.8vw, 4.35rem);
  line-height: 1.01;
  letter-spacing: -0.02em;
}

.section-head__copy {
  max-width: 24rem;
  margin-bottom: 0.4rem;
  color: var(--text-soft);
  font-size: 0.9375rem;
  line-height: 1.7;
}

.section-head__link {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.55rem;
  padding-bottom: 0.2rem;
  border-bottom: 1px solid var(--line-strong);
  color: var(--text);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  line-height: 1.4;
  text-transform: uppercase;
  transition: border-color 0.25s var(--ease), color 0.25s var(--ease);
}

.section-head__link .icon {
  width: 0.875rem;
  height: 0.875rem;
}

.section-head__link:hover {
  border-color: var(--accent);
  color: var(--accent-ink);
}

/* --------------------------------------------------------------------------
   6. Footer
   -------------------------------------------------------------------------- */
.site-footer {
  padding-top: clamp(3.5rem, 6vw, 5rem);
  border-top: 1px solid var(--line);
  background: var(--bg);
}

.footer__top {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) repeat(3, minmax(0, 0.62fr));
  gap: clamp(2rem, 5vw, 4rem);
}

.footer__brand .brand {
  font-size: 1.05rem;
}

.footer__tagline {
  margin: 1.4rem 0 1.5rem;
  font-family: var(--font-serif);
  font-size: 1.7rem;
  line-height: 1.18;
}

.footer__edition {
  color: var(--muted);
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.09em;
  line-height: 1.7;
  text-transform: uppercase;
}

.footer__col {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.footer__col h3 {
  margin: 0.2rem 0 1.05rem;
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  line-height: 1.4;
  text-transform: uppercase;
}

.footer__link {
  display: block;
  padding: 0.32rem 0;
  color: var(--text-soft);
  font-size: 0.875rem;
  line-height: 1.55;
  text-align: left;
  transition: color 0.2s var(--ease);
}

.footer__link:hover {
  color: var(--accent-ink);
}

.footer__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem 2rem;
  margin-top: clamp(3rem, 6vw, 4.5rem);
  padding-block: 1.5rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.6875rem;
  line-height: 1.6;
}

.footer__disclaimer {
  max-width: 30rem;
  text-align: center;
}

.footer__top-link {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-soft);
  font-weight: 500;
  transition: color 0.2s var(--ease);
}

.footer__top-link .icon {
  width: 0.8125rem;
  height: 0.8125rem;
}

.footer__top-link:hover {
  color: var(--accent-ink);
}

/* --------------------------------------------------------------------------
   7. Reveal, theme transitions, toast
   -------------------------------------------------------------------------- */
.js .reveal {
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity 0.7s var(--ease-out),
    transform 0.7s var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
}

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

html.theme-transitioning *,
html.theme-transitioning *::before,
html.theme-transitioning *::after {
  transition-property: background-color, border-color, color, fill, stroke, box-shadow !important;
  transition-duration: 0.35s !important;
  transition-timing-function: ease !important;
}

.toast-container {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  z-index: 1200;
  display: grid;
  width: max-content;
  max-width: calc(100vw - 2rem);
  gap: 0.5rem;
  pointer-events: none;
  transform: translateX(-50%);
}

.toast {
  padding: 0.7rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--text);
  color: var(--bg);
  box-shadow: var(--shadow-sm);
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.5;
  animation: toast-in 0.25s var(--ease-out);
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
}

.toast.is-leaving {
  opacity: 0;
  transform: translateY(4px);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
