:root {
  --paper: #FFFDF6;
  --ink: #202123;
  --gray: #6B6B6B;
  --deck: #4A4B4D;
  --brown: #655C44;
  --line: #E3DBC4;
  --pill: #D3C7A6;
  --orange: #E65A0D;
  --orange-hover: #CF4F0A;
  --serif: "Playfair Display", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; }
p, h1, h2, ul { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: inherit; }

/* ---------- Shared pieces ---------- */
.nav-link {
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  color: var(--ink);
}
.nav-link:hover { text-decoration: underline; text-underline-offset: 4px; }

.eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2.2px;
  color: var(--brown);
}
h1 {
  font-family: var(--serif);
  font-weight: 400;
  color: var(--ink);
}
.deck { color: var(--deck); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 16px;
  text-decoration: none;
  cursor: pointer;
}
.btn-primary { background: var(--orange); color: #fff; }
.btn-primary:hover { background: var(--orange-hover); }
.btn:focus-visible, .nav-link:focus-visible, .close:focus-visible, .link-btn:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}
.btn[disabled] { opacity: .7; cursor: default; }

.programs-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 2px;
  color: var(--brown);
}
.pills { display: flex; flex-wrap: wrap; }
.pills li {
  border: 1px solid var(--pill);
  border-radius: 999px;
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
}
.partners { color: var(--gray); line-height: 1.5; }
.foot { color: var(--gray); }

.wedges { position: absolute; pointer-events: none; }

/* ---------- Desktop (C1 single screen) ---------- */
@media (min-width: 900px) {
  .m-nav, .wedges-mobile { display: none; }

  .hero {
    position: relative;
    min-height: max(100vh, 720px);
    overflow: hidden;
  }
  .wedges-desktop {
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
  }
  .col {
    position: relative;
    z-index: 1;
    margin-left: 96px;
    width: min(700px, calc(100% - 96px));
    min-height: max(100vh, 720px);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 36px 0 30px;
  }
  .d-nav { display: flex; align-items: center; gap: 56px; }
  .d-nav .lockup { width: 150px; height: auto; }

  .card { display: flex; flex-direction: column; align-items: flex-start; padding: 32px 0; }
  .eyebrow { margin-bottom: 26px; }
  h1 {
    font-size: 80px;
    line-height: 1.02;
    letter-spacing: -2px;
    max-width: 600px;
  }
  .deck {
    margin-top: 26px;
    font-size: 18px;
    line-height: 1.55;
    max-width: 450px;
  }
  .card .btn { margin-top: 32px; height: 54px; padding: 0 32px; }

  .bottom { display: flex; flex-direction: column; gap: 16px; }
  .programs { display: flex; align-items: center; gap: 10px; }
  .pills { gap: 10px; }
  .pills li { font-size: 12px; padding: 6px 12px; }
  .partners { font-size: 14px; max-width: 683px; }
  .foot .sep { margin: 0 4px; }
  .foot {
    font-size: 11px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
  }
}

/* Keep text clear of the fan when the viewport gets narrower than the 1440 frame ratio */
@media (min-width: 900px) and (max-width: 1279px) {
  .wedges-desktop { transform: translateX(calc((1280px - 100vw) * 0.75)); }
  h1 { font-size: 72px; }
}
@media (min-width: 900px) and (max-height: 760px) {
  h1 { font-size: 72px; }
}

/* ---------- Mobile (M5 wedge field card) ---------- */
@media (max-width: 899px) {
  .wedges-desktop, .d-nav { display: none; }

  .m-nav {
    height: 64px;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--paper);
  }
  .m-nav .lockup { width: 124px; height: auto; }

  .card-zone {
    position: relative;
    overflow: hidden;
    padding: 56px 18px;
  }
  .wedges-mobile { inset: 0; width: 100%; height: 100%; }

  .card {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    padding: 32px 26px;
    border-radius: 24px;
    background: var(--paper);
    box-shadow: 0 14px 40px rgba(58, 52, 31, .15);
  }
  .eyebrow { font-size: 10px; letter-spacing: 2px; }
  h1 { font-size: 42px; line-height: 1.05; letter-spacing: -1px; }
  .deck { font-size: 15px; line-height: 1.55; }
  .card .btn { margin-top: 6px; height: 50px; padding: 0 28px; }

  .bottom { padding: 36px 20px 32px; display: flex; flex-direction: column; }
  .programs { display: flex; flex-direction: column; gap: 14px; }
  .pills { gap: 8px; }
  .pills li { font-size: 13px; padding: 6px 12px; }
  .partners { font-size: 14px; margin-top: 14px; }
  .foot {
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
    font-size: 11px;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
  }
  .foot .sep { display: none; }
}

/* ---------- Contact dialog ---------- */
.contact {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--ink);
  max-width: none;
  max-height: none;
}
.contact::backdrop {
  background: rgba(42, 38, 26, .36);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.contact-card {
  background: var(--paper);
  display: flex;
  flex-direction: column;
}
.contact-head { display: flex; align-items: center; justify-content: space-between; }
.close {
  border: 0;
  background: none;
  padding: 4px;
  margin: -4px;
  color: var(--gray);
  cursor: pointer;
  line-height: 0;
  border-radius: 8px;
}
.close:hover { color: var(--ink); }
.contact h2 {
  font-family: var(--serif);
  font-weight: 400;
  line-height: 1;
}
.contact-line { color: var(--gray); line-height: 1.5; }
.contact-form { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 7px; flex: 1; min-width: 0; }
.field label { font-size: 12px; font-weight: 500; color: var(--brown); }
.field input, .field textarea {
  width: 100%;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 0 14px;
  font: 400 15px/1.4 var(--sans);
  color: var(--ink);
}
.field textarea { height: 104px; padding: 12px 14px; resize: vertical; }
.field input:focus, .field textarea:focus {
  outline: none;
  border-color: var(--brown);
  box-shadow: 0 0 0 3px rgba(101, 92, 68, .15);
}
.hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.form-error { font-size: 13px; color: #A33A0B; }
.btn-block { width: 100%; height: 52px; margin-top: 6px; }
.contact-address { font-size: 12px; color: var(--gray); text-align: center; }
.contact-done { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; padding: 8px 0 12px; }
.contact-done[hidden] { display: none; }
.done-msg { font-family: var(--serif); font-size: 32px; line-height: 1.15; }
.link-btn {
  border: 0;
  background: none;
  padding: 0;
  font: 500 15px var(--sans);
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
}

@media (min-width: 900px) {
  .contact { margin: auto; }
  .contact-card {
    position: relative;
    width: 560px;
    max-width: calc(100vw - 32px);
    padding: 44px 48px;
    border-radius: 24px;
    gap: 16px;
    box-shadow: 0 24px 64px rgba(32, 33, 35, .2);
  }
  .sheet-lockup { display: none; }
  .contact-head { position: absolute; top: 44px; right: 48px; }
  .contact h2 { font-size: 52px; letter-spacing: -1.2px; padding-right: 40px; }
  .contact-line { font-size: 15px; margin-bottom: 4px; }
}

@media (max-width: 899px) {
  .contact {
    margin: 0;
    width: 100%;
    height: 100%;
    height: 100dvh;
  }
  .contact-card {
    min-height: 100%;
    padding: 20px 20px 28px;
    gap: 16px;
  }
  .contact-head { padding-bottom: 20px; }
  .sheet-lockup { width: 124px; height: auto; }
  .close { color: var(--ink); }
  .close svg { width: 24px; height: 24px; }
  .contact h2 { font-size: 44px; letter-spacing: -1px; }
  .contact-line { font-size: 15px; }
  .row { flex-direction: column; }
  .field label { font-size: 12px; }
  .field input { height: 46px; }
  .contact-address { font-size: 11px; line-height: 1.5; }
}

@media (prefers-reduced-motion: no-preference) {
  .contact[open] .contact-card { animation: rise .22s ease-out; }
  @keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
}

[hidden] { display: none !important; }
