:root {
  color-scheme: light;
  --ink: #17283b;
  --muted: #627285;
  --red: #b51f32;
  --gold: #dfb55d;
  --paper: #f7f5f0;
  --white: #fffdfa;
  font-family: "Manrope", "Segoe UI", Arial, sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  min-width: 320px;
  margin: 0;
  background: var(--paper);
  color: var(--ink);
}

a { color: inherit; }

button, input, textarea { font: inherit; }

a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

.topbar {
  position: sticky;
  z-index: 5;
  top: 0;
  display: flex;
  min-height: 76px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 10px clamp(18px, 5vw, 72px);
  border-bottom: 1px solid rgba(23, 40, 59, .08);
  background: rgba(255, 253, 250, .96);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
}

.brand img { width: 48px; height: 48px; object-fit: contain; }
.brand span { display: grid; gap: 2px; }
.brand strong { font-size: .94rem; letter-spacing: -.025em; }
.brand small { color: var(--muted); font-size: .74rem; }

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.install-help {
  max-width: 430px;
  margin: 18px 0 0;
  padding: 12px 14px;
  border-left: 3px solid var(--gold);
  border-radius: 0 9px 9px 0;
  background: rgba(255,255,255,.09);
  color: rgba(255,255,255,.82);
  font-size: .79rem;
  line-height: 1.6;
}

.connection-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: .76rem;
  font-weight: 700;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #d7a63c;
}

.connection-status.is-online .status-dot { background: #34866b; }
.connection-status.is-offline .status-dot { background: var(--red); }

.button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  font-size: .84rem;
  font-weight: 800;
  text-decoration: none;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

.button:hover { transform: translateY(-2px); }
.button-dark { background: var(--ink); color: #fff; }
.button-dark:hover { background: #223b55; box-shadow: 0 8px 22px rgba(23, 40, 59, .16); }
.button-gold { background: var(--gold); color: #17283b; }
.button-gold:hover { background: #ebc675; box-shadow: 0 8px 22px rgba(23, 40, 59, .16); }
.button-light { border-color: rgba(23, 40, 59, .14); background: #fff; color: var(--ink); }
.button-outline { border-color: rgba(23, 40, 59, .2); background: transparent; color: var(--ink); }
.button-wide { width: 100%; margin-top: 20px; }

.welcome {
  position: relative;
  display: grid;
  min-height: 430px;
  grid-template-columns: minmax(0, 1fr) 260px;
  align-items: center;
  gap: 30px;
  overflow: hidden;
  padding: 64px clamp(24px, 9vw, 132px);
  background:
    radial-gradient(ellipse at 86% 30%, rgba(223, 181, 93, .2), transparent 36%),
    linear-gradient(120deg, #14263a, #1e3851 72%, #27465e);
  color: white;
}

.welcome::after {
  position: absolute;
  right: -110px;
  bottom: -240px;
  width: 560px;
  height: 560px;
  border: 1px solid rgba(223, 181, 93, .18);
  border-radius: 50%;
  box-shadow: 0 0 0 36px rgba(223, 181, 93, .04), 0 0 0 80px rgba(223, 181, 93, .03);
  content: "";
}

.welcome-copy { position: relative; z-index: 1; max-width: 660px; }
.eyebrow { margin: 0 0 12px; color: var(--red); font-size: .68rem; font-weight: 900; letter-spacing: .16em; }
.welcome .eyebrow { color: var(--gold); }
.welcome h1 { margin: 0; font-size: clamp(2.6rem, 6vw, 5.2rem); letter-spacing: -.065em; line-height: .99; }
.welcome h1 span { color: var(--gold); }
.welcome-copy > p:not(.eyebrow) { max-width: 560px; margin: 20px 0 25px; color: rgba(255,255,255,.77); font-size: 1.02rem; line-height: 1.75; }
.welcome-mark { position: relative; z-index: 1; justify-self: center; text-align: center; }
.heart-orbit {
  display: grid;
  width: 190px;
  height: 190px;
  place-items: center;
  border: 1px solid rgba(223, 181, 93, .62);
  border-radius: 50%;
  box-shadow: 0 0 0 18px rgba(223,181,93,.035), 0 0 0 37px rgba(223,181,93,.025);
}
.heart-orbit::before { position: absolute; width: 108px; height: 108px; border: 1px solid rgba(223,181,93,.3); border-radius: 50%; content: ""; }
.heart-orbit span { color: var(--gold); font-size: 2.8rem; font-weight: 800; letter-spacing: -.08em; }
.welcome-mark p { margin: 24px 0 0; color: rgba(255,255,255,.7); font-size: .68rem; font-weight: 800; letter-spacing: .14em; }

.today-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  padding: 28px clamp(24px, 9vw, 132px);
  background: var(--white);
}
.today-strip .eyebrow { margin-bottom: 5px; }
.today-strip h2 { margin: 0; font-size: clamp(1.2rem, 2.4vw, 1.65rem); letter-spacing: -.035em; }
.today-strip > p { max-width: 480px; margin: 0; color: var(--muted); font-size: .86rem; line-height: 1.65; }

.content-section { max-width: 1250px; margin: auto; padding: 78px 28px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 26px; }
.section-heading h2, .calendar-copy h2, .member-callout h2 { margin: 0; font-size: clamp(2rem, 4vw, 3.2rem); letter-spacing: -.055em; line-height: 1.05; }
.section-heading > p { max-width: 450px; margin: 0; color: var(--muted); font-size: .91rem; line-height: 1.7; }

.hours-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.hour-card {
  position: relative;
  display: grid;
  min-height: 164px;
  align-content: end;
  gap: 8px;
  overflow: hidden;
  padding: 22px;
  border: 1px solid rgba(23, 40, 59, .09);
  border-radius: 18px;
  background: var(--white);
  box-shadow: 0 8px 24px rgba(23, 40, 59, .035);
  text-decoration: none;
  transition: transform .2s ease, box-shadow .2s ease;
}
.hour-card:hover { transform: translateY(-4px); box-shadow: 0 16px 30px rgba(23, 40, 59, .1); }
.hour-card::before { position: absolute; top: -34px; right: -24px; width: 112px; height: 112px; border: 1px solid rgba(223,181,93,.34); border-radius: 50%; content: ""; }
.hour-featured { border-color: rgba(23,40,59,.55); background: var(--ink); color: white; }
.hour-featured .hour-time { color: var(--gold); }
.hour-symbol { position: absolute; top: 20px; left: 22px; color: rgba(181,31,50,.6); font-size: 1.3rem; font-weight: 900; letter-spacing: .04em; }
.hour-featured .hour-symbol { color: rgba(223,181,93,.75); }
.hour-time { color: var(--red); font-size: .63rem; font-weight: 900; letter-spacing: .15em; }
.hour-card strong { max-width: 82%; font-size: 1.12rem; letter-spacing: -.025em; }
.card-arrow { position: absolute; right: 21px; bottom: 21px; color: var(--gold); font-size: 1.2rem; }
.source-note { margin: 20px 0 0; color: var(--muted); font-size: .8rem; line-height: 1.6; }
.source-note a { color: var(--red); font-weight: 800; }

.calendar-section { display: grid; max-width: none; grid-template-columns: minmax(0, 1fr) 270px; align-items: center; gap: 48px; padding: 64px max(28px, calc((100vw - 1194px) / 2)); background: #eee8dd; }
.calendar-copy { max-width: 740px; }
.calendar-copy p:not(.eyebrow) { max-width: 700px; margin: 18px 0 22px; color: var(--muted); line-height: 1.75; }
.calendar-date { display: grid; min-height: 192px; align-content: center; justify-items: center; gap: 8px; border: 1px solid rgba(23,40,59,.12); border-radius: 22px; background: rgba(255,253,250,.72); text-align: center; }
.calendar-flourish { color: var(--red); font-size: 1.2rem; }
.calendar-label { color: var(--muted); font-size: .61rem; font-weight: 900; letter-spacing: .14em; }
.calendar-date strong { font-size: 1.65rem; letter-spacing: -.04em; }
.calendar-date > span:last-child { color: var(--muted); font-size: .82rem; }

.search-box input { width: min(330px, 40vw); min-height: 44px; padding: 0 14px; border: 1px solid rgba(23,40,59,.17); border-radius: 12px; background: var(--white); color: var(--ink); }
.resource-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.resource-card { display: grid; grid-template-columns: 44px minmax(0, 1fr) 18px; align-items: center; gap: 14px; padding: 17px; border: 1px solid rgba(23,40,59,.09); border-radius: 15px; background: var(--white); text-decoration: none; transition: transform .18s ease, border-color .18s ease; }
.resource-card:hover { transform: translateY(-2px); border-color: rgba(181,31,50,.35); }
.resource-icon { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 13px; background: #f1e7d4; color: var(--red); font-size: 1.35rem; }
.resource-card strong, .resource-card small { display: block; }
.resource-card strong { font-size: .9rem; }
.resource-card small { margin-top: 4px; color: var(--muted); font-size: .73rem; line-height: 1.45; }
.resource-card > span:last-child { color: var(--red); font-weight: 900; }

.member-callout { display: flex; align-items: center; justify-content: space-between; gap: 26px; padding: 54px clamp(26px, 9vw, 132px); background: var(--ink); color: white; }
.member-callout .eyebrow { color: var(--gold); }
.member-callout h2 { max-width: 620px; font-size: clamp(1.8rem, 4vw, 2.7rem); }
.member-callout p:not(.eyebrow) { max-width: 660px; margin: 14px 0 0; color: rgba(255,255,255,.72); line-height: 1.7; }
.app-footer { display: flex; justify-content: space-between; gap: 15px; padding: 20px clamp(22px, 5vw, 72px); background: #101f30; color: rgba(255,255,255,.7); font-size: .73rem; }
.app-footer a { color: white; text-decoration: none; }

.members-main { min-height: calc(100vh - 140px); padding: 64px 20px 80px; }
.members-heading { max-width: 700px; margin: 0 auto 28px; text-align: center; }
.members-heading h1 { margin: 0; font-size: clamp(2.5rem, 6vw, 4rem); letter-spacing: -.06em; }
.members-heading > p:not(.eyebrow) { color: var(--muted); line-height: 1.7; }
.private-note { display: inline-block; padding: 9px 13px; border-radius: 9px; background: #eee8dd; color: var(--ink) !important; font-size: .78rem; }
.portal-card { max-width: 760px; margin: 0 auto; padding: clamp(22px, 5vw, 38px); border: 1px solid rgba(23,40,59,.1); border-radius: 20px; background: var(--white); box-shadow: 0 14px 45px rgba(23,40,59,.07); }
.portal-card h2 { margin: 0 0 20px; font-size: 1.45rem; letter-spacing: -.035em; }
.portal-card label { display: block; margin: 16px 0 7px; color: var(--ink); font-size: .8rem; font-weight: 800; }
.portal-card input:not([type="file"]), .portal-card textarea, .portal-card input[type="file"] { width: 100%; min-height: 46px; padding: 11px 13px; border: 1px solid rgba(23,40,59,.18); border-radius: 10px; background: #fff; color: var(--ink); }
.portal-card textarea { resize: vertical; }
.small-note { color: var(--muted); font-size: .78rem; line-height: 1.65; }
.form-message { max-width: 760px; min-height: 1.4em; margin: 0 auto 12px; color: var(--red); font-size: .86rem; font-weight: 700; }
.portal-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.portal-toolbar h2 { margin: 0; }
.materials-list { display: grid; gap: 10px; margin-top: 15px; }
.material-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 15px; border: 1px solid rgba(23,40,59,.1); border-radius: 12px; background: #fff; }
.material-row strong, .material-row small { display: block; }
.material-row small { margin-top: 4px; color: var(--muted); font-size: .75rem; line-height: 1.5; }
.material-download { flex: 0 0 auto; color: var(--red); font-size: .8rem; font-weight: 800; }
.admin-tools { margin-top: 38px; padding-top: 27px; border-top: 1px solid rgba(23,40,59,.12); }
.admin-tools h3 { margin: 0 0 18px; }
.admin-form { margin-top: 15px; padding: 18px; border: 1px solid rgba(23,40,59,.11); border-radius: 14px; }
.admin-form h4 { margin: 0 0 12px; font-size: 1rem; }
.admin-form .button { margin-top: 16px; }
.back-link { display: block; width: fit-content; margin: 25px auto 0; color: var(--red); font-size: .85rem; font-weight: 800; text-decoration: none; }
.offline-card { max-width: 560px; margin: 12vh auto; padding: 32px; border-top: 5px solid var(--gold); border-radius: 20px; background: var(--white); box-shadow: 0 16px 42px rgba(23,40,59,.1); }
.offline-card h1 { margin: 0 0 12px; font-size: 2rem; }
.offline-card p:not(.eyebrow) { color: var(--muted); line-height: 1.75; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; clip-path: inset(50%); }

[hidden] { display: none !important; }

@media (max-width: 760px) {
  .topbar { flex-wrap: wrap; padding: 10px 16px; }
  .topbar-actions { gap: 8px; }
  .connection-status { font-size: 0; }
  .connection-status .status-dot { width: 10px; height: 10px; }
  .topbar .button { min-height: 40px; padding: 0 12px; font-size: .72rem; }
  .welcome { min-height: 390px; grid-template-columns: 1fr; padding: 64px 25px; }
  .welcome-mark { display: none; }
  .today-strip, .section-heading, .member-callout { align-items: flex-start; flex-direction: column; }
  .content-section { padding: 60px 20px; }
  .hours-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hour-card { min-height: 150px; }
  .calendar-section { grid-template-columns: 1fr; gap: 26px; padding: 54px 22px; }
  .calendar-date { min-height: 150px; }
  .resource-grid { grid-template-columns: 1fr; }
  .search-box, .search-box input { width: 100%; }
  .app-footer { flex-direction: column; }
  .members-main { padding-top: 48px; }
}

@media (max-width: 420px) {
  .brand img { width: 40px; height: 40px; }
  .brand strong { font-size: .8rem; }
  .brand small { font-size: .68rem; }
  .topbar-actions .button { padding: 0 9px; font-size: .66rem; }
  .hours-grid { grid-template-columns: 1fr; }
  .hour-card { min-height: 130px; }
  .material-row { align-items: flex-start; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
