:root {
  --bg: oklch(96.96% 0.0026 106.45);
  --surface: oklch(100% 0 0);
  --fg: oklch(21.03% 0.0059 285.89);
  --muted: oklch(55.99% 0.0046 286.25);
  --border: oklch(92.71% 0.004 106.48);
  --accent: oklch(77.60% 0.2292 145.75);
  --ink: oklch(16.38% 0 0);
  --blue: oklch(66% 0.16 246);
  --amber: oklch(80% 0.16 88);
  --orange: oklch(66% 0.2 42);
  --brand-gradient: linear-gradient(
    90deg,
    #e88e00 0%,
    #f06516 34%,
    #ed304a 58%,
    #b52c72 79%,
    #5d5097 100%
  );
  --danger: oklch(59% 0.22 28);
  --font-display: "Avenir Next", "Century Gothic", "Futura", sans-serif;
  --font-body: "Avenir Next", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-editorial: "Iowan Old Style", "Baskerville", Georgia, serif;
  --font-mono: ui-monospace, "SFMono-Regular", Menlo, monospace;
  --shadow-soft: 0 24px 70px color-mix(in oklch, var(--fg) 9%, transparent);
}

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

html {
  min-width: 320px;
  background: var(--bg);
  color: var(--fg);
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100svh;
  margin: 0;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  line-height: 1.45;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

button,
a {
  color: inherit;
  font: inherit;
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

a {
  text-decoration: none;
}

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

button:focus-visible,
a:focus-visible {
  outline: 3px solid color-mix(in oklch, var(--accent) 36%, transparent);
  outline-offset: 3px;
}

.icon {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.home-page {
  min-height: 100svh;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid color-mix(in oklch, var(--border) 78%, transparent);
  background: color-mix(in oklch, var(--bg) 91%, transparent);
  backdrop-filter: blur(18px);
}

.app-header-inner {
  display: flex;
  width: min(100%, 1340px);
  min-height: 76px;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  margin-inline: auto;
  padding-inline: clamp(22px, 4vw, 56px);
}

.app-logo {
  width: 92px;
  height: auto;
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px;
  border-radius: 999px;
  background: var(--surface);
}

.desktop-nav a {
  min-height: 40px;
  padding: 10px 17px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.desktop-nav a:hover {
  color: var(--fg);
}

.desktop-nav a[aria-current="page"] {
  background: var(--ink);
  color: var(--surface);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-button,
.avatar-button,
.carousel-button {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--fg);
  transition: transform 120ms ease, border-color 160ms ease;
}

.icon-button:hover,
.avatar-button:hover,
.carousel-button:hover {
  border-color: color-mix(in oklch, var(--fg) 34%, var(--border));
}

.icon-button:active,
.avatar-button:active,
.carousel-button:active {
  transform: scale(.96);
}

.avatar-button {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--surface);
  font-size: 12px;
  font-weight: 700;
}

.home-main {
  width: min(100%, 1340px);
  margin-inline: auto;
  padding: clamp(36px, 5vw, 72px) clamp(22px, 4vw, 56px) 112px;
}

.welcome-section {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: clamp(38px, 5vw, 62px);
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.welcome-section h1,
.section-heading h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -.055em;
  line-height: .98;
  text-wrap: balance;
}

.welcome-section h1 {
  max-width: 12ch;
  font-size: clamp(48px, 6vw, 86px);
}

.welcome-section h1 em,
.section-heading h2 em {
  font-family: var(--font-editorial);
  font-weight: 600;
}

.welcome-note {
  max-width: 34ch;
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 15px;
  text-wrap: pretty;
}

.signal-line {
  width: 112px;
  height: 5px;
  margin-bottom: 20px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--brand-gradient);
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.section-heading h2 {
  font-size: clamp(31px, 3.4vw, 46px);
}

.section-heading p {
  max-width: 34ch;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  text-align: right;
}

.agenda-section,
.events-section,
.ministry-section {
  scroll-margin-top: 96px;
}

.agenda-card {
  padding: clamp(20px, 3vw, 32px);
  border: 1px solid var(--border);
  border-radius: 28px;
  background: var(--surface);
  box-shadow: 0 18px 50px color-mix(in oklch, var(--fg) 5%, transparent);
}

.week-strip {
  display: grid;
  grid-template-columns: repeat(7, minmax(72px, 1fr));
  gap: 9px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.day-button {
  display: grid;
  min-height: 88px;
  place-items: center;
  gap: 4px;
  padding: 12px 8px;
  border: 1px solid transparent;
  border-radius: 20px;
  background: var(--bg);
  color: var(--muted);
  transition: transform 120ms ease, background 160ms ease, color 160ms ease;
}

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

.day-button:active {
  transform: scale(.98);
}

.day-button[aria-pressed="true"] {
  background: var(--ink);
  color: var(--surface);
}

.day-name {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.day-number {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  line-height: 1;
}

.day-mark {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
  opacity: .45;
}

.agenda-detail {
  display: grid;
  grid-template-columns: minmax(150px, .55fr) 1.45fr;
  gap: 28px;
  padding-top: 25px;
}

.agenda-date {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.agenda-date strong {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -.035em;
}

.agenda-date span {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
}

.agenda-list {
  display: grid;
  gap: 9px;
}

.agenda-item {
  display: grid;
  grid-template-columns: 70px 1fr auto;
  min-height: 72px;
  align-items: center;
  gap: 16px;
  padding: 12px 14px;
  border-radius: 18px;
  background: var(--bg);
}

.agenda-time {
  font-family: var(--font-mono);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.agenda-copy strong,
.agenda-copy span {
  display: block;
}

.agenda-copy strong {
  font-size: 14px;
  font-weight: 650;
}

.agenda-copy span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.agenda-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
}

.agenda-status::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

.empty-agenda {
  margin: 0;
  padding: 18px;
  border-radius: 18px;
  background: var(--bg);
  color: var(--muted);
  font-size: 13px;
}

.home-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, .55fr);
  gap: clamp(22px, 3vw, 38px);
  align-items: start;
  margin-top: clamp(54px, 7vw, 88px);
}

.carousel-shell {
  position: relative;
}

.carousel-window {
  overflow: hidden;
  border-radius: 30px;
  background: var(--ink);
}

.carousel-track {
  display: flex;
  transition: transform 420ms cubic-bezier(.2, .7, .2, 1);
}

.event-slide {
  min-width: 100%;
}

.event-card {
  position: relative;
  min-height: clamp(390px, 45vw, 590px);
  overflow: hidden;
  color: var(--surface);
}

.event-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1) contrast(1.04);
}

.event-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 35%, color-mix(in oklch, var(--ink) 92%, transparent) 100%);
  pointer-events: none;
}

.event-copy {
  position: absolute;
  z-index: 2;
  right: clamp(22px, 4vw, 44px);
  bottom: clamp(24px, 4vw, 42px);
  left: clamp(22px, 4vw, 44px);
}

.event-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-bottom: 13px;
  color: color-mix(in oklch, var(--surface) 74%, transparent);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.event-copy h3 {
  max-width: 12ch;
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(34px, 4vw, 57px);
  font-weight: 500;
  letter-spacing: -.055em;
  line-height: .96;
}

.event-copy p {
  max-width: 42ch;
  margin: 13px 0 0;
  color: color-mix(in oklch, var(--surface) 72%, transparent);
  font-size: 14px;
}

.carousel-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
}

.carousel-buttons {
  display: flex;
  gap: 8px;
}

.carousel-button {
  width: 42px;
  height: 42px;
}

.carousel-dots {
  display: flex;
  align-items: center;
  gap: 7px;
}

.carousel-dot {
  width: 7px;
  height: 7px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: color-mix(in oklch, var(--muted) 34%, transparent);
  transition: width 180ms ease, background 180ms ease;
}

.carousel-dot[aria-current="true"] {
  width: 24px;
  background: var(--fg);
}

.ministry-section {
  position: sticky;
  top: 108px;
}

.ministry-card {
  position: relative;
  overflow: hidden;
  min-height: 510px;
  padding: 28px;
  border-radius: 30px;
  background: var(--ink);
  color: var(--surface);
}

.ministry-card::after {
  content: "";
  position: absolute;
  right: -36%;
  bottom: -18%;
  width: 110%;
  aspect-ratio: 1;
  border: 1px solid color-mix(in oklch, var(--surface) 13%, transparent);
  border-radius: 50%;
  box-shadow:
    inset 0 0 0 52px color-mix(in oklch, var(--surface) 2%, transparent),
    inset 0 0 0 104px color-mix(in oklch, var(--surface) 2%, transparent);
}

.ministry-top,
.ministry-body,
.ministry-action {
  position: relative;
  z-index: 1;
}

.ministry-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ministry-kicker {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.ministry-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 50%;
  background: var(--surface);
  color: var(--fg);
}

.ministry-body {
  margin-top: clamp(72px, 10vw, 124px);
}

.ministry-body h2 {
  max-width: 8ch;
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(39px, 4.4vw, 61px);
  font-weight: 500;
  letter-spacing: -.06em;
  line-height: .93;
}

.ministry-body h2 em {
  display: block;
  color: color-mix(in oklch, var(--surface) 68%, transparent);
  font-family: var(--font-editorial);
  font-weight: 600;
}

.ministry-body p {
  max-width: 28ch;
  margin: 20px 0 0;
  color: color-mix(in oklch, var(--surface) 62%, transparent);
  font-size: 13px;
}

.ministry-action {
  position: absolute;
  right: 28px;
  bottom: 28px;
  left: 28px;
}

.ministry-button {
  display: inline-flex;
  width: 100%;
  min-height: 54px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 18px;
  border: 0;
  border-radius: 18px;
  background: var(--surface);
  color: var(--fg);
  font-weight: 650;
}

.web-mobile-nav {
  display: none;
  z-index: 18;
  align-items: center;
  justify-content: space-around;
}

.web-mobile-nav a {
  display: flex;
  min-width: 58px;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 999px;
  color: color-mix(in oklch, var(--surface) 54%, transparent);
}

.web-mobile-nav a span {
  display: none;
}

.ministry-dialog {
  width: min(calc(100% - 32px), 480px);
  padding: 0;
  border: 0;
  border-radius: 28px;
  background: var(--surface);
  color: var(--fg);
  box-shadow: var(--shadow-soft);
}

.ministry-dialog::backdrop {
  background: color-mix(in oklch, var(--ink) 58%, transparent);
  backdrop-filter: blur(6px);
}

.dialog-card {
  padding: 28px;
}

.dialog-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.dialog-top h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 31px;
  font-weight: 500;
  letter-spacing: -.045em;
}

.dialog-close {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--bg);
}

.dialog-card > p {
  margin: 18px 0 24px;
  color: var(--muted);
}

.empty-library {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 17px;
  border-radius: 18px;
  background: var(--bg);
}

.empty-library .ministry-icon {
  flex: 0 0 auto;
  background: var(--surface);
}

.empty-library strong,
.empty-library span {
  display: block;
}

.empty-library span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 940px) {
  .desktop-nav {
    display: none;
  }

  .home-grid {
    grid-template-columns: 1fr;
  }

  .ministry-section {
    position: static;
  }

  .ministry-card {
    min-height: 430px;
  }
}

@media (max-width: 720px) {
  .app-header-inner {
    min-height: 66px;
  }

  .app-logo {
    width: 83px;
  }

  .header-actions .icon-button {
    display: none;
  }

  .home-main {
    padding-bottom: 116px;
  }

  .welcome-section {
    display: block;
  }

  .welcome-note {
    margin-top: 18px;
  }

  .section-heading {
    align-items: center;
  }

  .section-heading p {
    max-width: 20ch;
    font-size: 12px;
  }

  .week-strip {
    grid-template-columns: repeat(7, 62px);
    margin-inline: -4px;
    padding-inline: 4px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .week-strip::-webkit-scrollbar {
    display: none;
  }

  .agenda-detail {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .agenda-date {
    flex-direction: row;
    align-items: center;
  }

  .agenda-item {
    grid-template-columns: 58px 1fr;
  }

  .agenda-status {
    display: none;
  }

  .event-card {
    min-height: 360px;
  }

  .web-mobile-nav {
    position: fixed;
    right: 16px;
    bottom: 14px;
    left: 16px;
    display: flex;
    min-height: 66px;
    padding: 7px;
    border-radius: 999px;
    background: var(--ink);
    box-shadow: var(--shadow-soft);
  }

  .web-mobile-nav a[aria-current="page"] {
    padding-inline: 18px;
    background: var(--surface);
    color: var(--fg);
  }

  .web-mobile-nav a[aria-current="page"] span {
    display: inline;
    font-size: 12px;
    font-weight: 650;
  }
}

@media (max-width: 390px) {
  .home-main {
    padding-inline: 16px;
  }

  .agenda-card {
    padding: 14px;
  }

  .event-card {
    min-height: 330px;
  }

  .event-copy h3 {
    font-size: 32px;
  }
}

@media (min-width: 1440px) {
  .home-grid {
    grid-template-columns: minmax(0, 1.6fr) minmax(340px, .5fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}
