:root {
  --bg: #f3efe7;
  --bg-soft: #fbf8f2;
  --panel: rgba(255, 252, 246, 0.88);
  --panel-strong: rgba(255, 250, 242, 0.96);
  --text: #27285f;
  --muted: #5f6487;
  --line: #cfc7bb;
  --gold: #b48312;
  --gold-strong: #cb9720;
  --navy: #27285f;
  --blue-soft: #e7ebf6;
  --shadow: 0 22px 50px rgba(62, 56, 102, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(181, 138, 82, 0.1), transparent 26%),
    radial-gradient(circle at top right, rgba(182, 203, 224, 0.18), transparent 30%),
    linear-gradient(180deg, #f7f3ec 0%, #eef2f6 52%, #f7f8fa 100%);
}

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

button,
input {
  font: inherit;
}

.page-shell {
  position: relative;
  overflow: hidden;
}

.page-shell::before,
.page-shell::after {
  content: "";
  position: fixed;
  z-index: 0;
  pointer-events: none;
  background: url("./images/monogram.jpeg") center/contain no-repeat;
  opacity: 0.045;
  filter: grayscale(100%) saturate(0.3);
}

.page-shell::before {
  top: 7rem;
  right: -1rem;
  width: 220px;
  height: 220px;
  transform: rotate(8deg);
}

.page-shell::after {
  left: -2rem;
  bottom: 8rem;
  width: 180px;
  height: 180px;
  transform: rotate(-10deg);
}

.topbar {
  position: relative;
  z-index: 3;
  width: min(1200px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.3rem 0 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.95rem;
  padding: 0.7rem 1rem;
  border: 1px solid rgba(39, 40, 95, 0.08);
  border-radius: 999px;
  background: rgba(255, 252, 247, 0.78);
  box-shadow: 0 10px 26px rgba(39, 40, 95, 0.08);
  backdrop-filter: blur(10px);
}

.brand__mark {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  object-fit: cover;
  background: #fff;
}

.brand__logo {
  height: 38px;
  width: auto;
  object-fit: contain;
}

.hero {
  position: relative;
  min-height: 72vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4rem clamp(1.5rem, 4vw, 4rem) 6rem;
  background:
    radial-gradient(circle at 12% 18%, rgba(180, 131, 18, 0.12), transparent 20%),
    radial-gradient(circle at 88% 22%, rgba(39, 40, 95, 0.1), transparent 24%),
    linear-gradient(180deg, #f9f5ee 0%, #eef1f8 100%);
}

.hero__overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(255, 251, 246, 0.16) 0%, rgba(236, 241, 246, 0.42) 100%);
}

.hero__overlay::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(113, 125, 168, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(113, 125, 168, 0.08) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.55));
}

.hero__overlay::after {
  content: "";
  position: absolute;
  right: clamp(2rem, 8vw, 6rem);
  bottom: 3.5rem;
  width: 210px;
  height: 210px;
  border-radius: 40px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.68), rgba(255, 255, 255, 0.14)),
    url("./images/monogram.jpeg") center/contain no-repeat;
  box-shadow: 0 22px 40px rgba(39, 40, 95, 0.08);
  opacity: 0.22;
  transform: rotate(-8deg);
}

.hero__content {
  position: relative;
  z-index: 1;
  width: min(780px, 100%);
  margin: 0 auto;
  padding: clamp(1.8rem, 3vw, 2.6rem);
  border: 1px dashed rgba(39, 40, 95, 0.16);
  border-radius: 1.75rem;
  text-align: center;
  background: linear-gradient(180deg, rgba(255, 252, 247, 0.86), rgba(249, 251, 253, 0.96));
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
  animation: fadeUp 0.8s ease-out both;
}

.hero__logo {
  display: block;
  height: auto;
  width: min(420px, 78%);
  margin: 0 auto 1rem;
  object-fit: contain;
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  padding: 0.55rem 1rem;
  border: 1px solid rgba(180, 131, 18, 0.22);
  border-radius: 999px;
  background: rgba(180, 131, 18, 0.08);
  color: var(--gold-strong);
  font-weight: 700;
  letter-spacing: 0.04em;
}

.eyebrow,
.section-kicker {
  margin: 0 0 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.78rem;
  color: var(--gold-strong);
}

.hero h1,
.cards-section h2,
.search-panel h2,
.portal-card h3 {
  font-family: Georgia, "Times New Roman", serif;
}

.hero h1 {
  margin: 0 0 1rem;
  font-size: clamp(2.8rem, 5vw, 4.8rem);
  line-height: 0.98;
  color: var(--navy);
}

.hero__lead {
  margin: 0 auto;
  max-width: 42rem;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.75;
}

.hero__actions {
  display: flex;
  justify-content: center;
  margin-top: 1.75rem;
}

.hero__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 220px;
  padding: 0.95rem 1.4rem;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--gold-strong), var(--gold));
  color: #fffdf8;
  font-weight: 800;
  box-shadow: 0 12px 36px rgba(180, 131, 18, 0.2);
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.hero__cta:hover,
.hero__cta:focus-visible {
  transform: translateY(-2px);
  filter: brightness(1.03);
  box-shadow: 0 18px 42px rgba(180, 131, 18, 0.28);
}

.portal-content {
  width: min(1200px, calc(100% - 2rem));
  margin: -3rem auto 4rem;
  position: relative;
  z-index: 2;
}

.search-panel,
.portal-card {
  background: var(--panel);
  border: 1px dashed var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.search-panel {
  padding: clamp(1.5rem, 3vw, 2rem);
  border-radius: 1.5rem;
  animation: fadeUp 0.9s ease-out both;
  background:
    linear-gradient(180deg, rgba(255, 252, 246, 0.95), rgba(247, 249, 252, 0.92));
}

.search-panel__header h2,
.cards-section__header h2 {
  margin: 0;
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  color: var(--navy);
}

.search-panel__copy {
  margin: 1rem 0 1.25rem;
  max-width: 46rem;
  color: var(--muted);
  line-height: 1.7;
}

.search-panel__field {
  display: block;
  padding: 1rem;
  border: 1px dashed var(--line);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.55);
}

.search-panel__field input {
  width: 100%;
  border: 0;
  outline: none;
  color: var(--text);
  background: transparent;
}

.search-panel__field input::placeholder {
  color: #8a95a3;
}

.cards-section {
  margin-top: 2rem;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
  align-items: start;
}

.portal-card[hidden] {
  display: none;
}

.portal-card {
  display: flex;
  flex-direction: column;
  align-self: start;
  border-radius: 1.5rem;
  overflow: hidden;
  animation: fadeUp 1s ease-out both;
  background:
    linear-gradient(180deg, rgba(255, 252, 246, 0.95), rgba(248, 250, 252, 0.94));
}

.portal-card:nth-child(2) {
  animation-delay: 0.08s;
}

.portal-card:nth-child(3) {
  animation-delay: 0.16s;
}

.portal-card__media {
  height: 180px;
  background-size: cover;
  background-position: center;
  position: relative;
}

.portal-card__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 248, 238, 0.04), rgba(34, 41, 52, 0.28));
}

.portal-card__media--tools {
  background:
    linear-gradient(135deg, rgba(219, 229, 240, 0.16), rgba(181, 138, 82, 0.1)),
    url("./images/ai-tools.jpg") center/cover no-repeat;
}

.portal-card__media--clinic {
  background:
    linear-gradient(135deg, rgba(219, 229, 240, 0.16), rgba(181, 138, 82, 0.1)),
    url("./images/ai-clinic.jpg") center/cover no-repeat;
}

.portal-card__media--admin {
  background:
    linear-gradient(135deg, rgba(219, 229, 240, 0.16), rgba(181, 138, 82, 0.1)),
    url("./images/admin-process.jpg") center/cover no-repeat;
}

.portal-card__body {
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
}

.portal-card h3 {
  margin: 0 0 0.9rem;
  font-size: 1.75rem;
  color: var(--navy);
}

.portal-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.portal-card__actions {
  margin-top: auto;
  padding-top: 1.5rem;
}

.action-button {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  border: 0;
  border-radius: 999px;
  padding: 0.85rem 1.3rem;
  color: #fffaf3;
  background: linear-gradient(135deg, var(--gold-strong), var(--gold));
  cursor: pointer;
  font-weight: 700;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    filter 0.2s ease;
  box-shadow: 0 10px 24px rgba(181, 138, 82, 0.22);
}

.action-button__chevron {
  width: 0.55rem;
  height: 0.55rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-1px);
  transition: transform 0.2s ease;
}

.action-button[aria-expanded="true"] .action-button__chevron {
  transform: rotate(-135deg) translateY(-1px);
}

.action-button:hover,
.action-button:focus-visible {
  transform: translateY(-2px);
  filter: brightness(1.03);
  box-shadow: 0 14px 28px rgba(181, 138, 82, 0.26);
}

.action-button:focus-visible,
.portal-menu a:focus-visible,
.hero__cta:focus-visible {
  outline: 2px solid var(--gold-strong);
  outline-offset: 3px;
}

.portal-menu {
  display: grid;
  gap: 0.75rem;
  margin-top: 1rem;
  padding: 1rem;
  border: 1px dashed var(--line);
  border-radius: 1rem;
  background: var(--panel-strong);
}

.portal-menu[hidden] {
  display: none;
}

.portal-menu a {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.9rem 1rem;
  border-radius: 0.85rem;
  background: rgba(223, 232, 242, 0.35);
  transition: background-color 0.2s ease, color 0.2s ease;
}

.portal-menu a:hover {
  color: #1f2a37;
  background: rgba(181, 138, 82, 0.16);
}

.portal-menu a[hidden] {
  display: none;
}

.portal-menu a.app-link--match {
  background: rgba(180, 131, 18, 0.15);
  box-shadow: inset 0 0 0 1px rgba(180, 131, 18, 0.2);
}

.app-link__icon {
  flex: 0 0 2.8rem;
  width: 2.8rem;
  height: 2.8rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.95rem;
  background: linear-gradient(180deg, rgba(39, 40, 95, 0.1), rgba(39, 40, 95, 0.04));
  color: var(--navy);
}

.app-link__icon svg {
  width: 1.35rem;
  height: 1.35rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.app-link__content {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.app-link__content strong {
  color: var(--navy);
  font-size: 0.98rem;
}

.app-link__content span {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.4;
}

.inline-message {
  margin-top: 0.9rem;
  color: #8d6a3d;
  font-weight: 600;
}

.search-empty-state {
  margin: 1rem 0 0;
  padding: 1rem 1.1rem;
  border: 1px dashed var(--line);
  border-radius: 1rem;
  color: var(--muted);
  background: rgba(255, 252, 246, 0.72);
}

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

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(18px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 960px) {
  .hero {
    min-height: 64vh;
    padding-top: 5rem;
  }

  .portal-content {
    margin-top: -2rem;
  }

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

  .brand__logo {
    height: 30px;
  }

  .hero__overlay::after {
    width: 160px;
    height: 160px;
    right: 1.5rem;
    bottom: 2rem;
  }
}

@media (max-width: 640px) {
  .page-shell::before,
  .page-shell::after {
    opacity: 0.03;
  }

  .topbar {
    width: min(1200px, calc(100% - 1rem));
    padding-top: 0.9rem;
  }

  .brand {
    gap: 0.7rem;
    padding: 0.6rem 0.8rem;
  }

  .brand__mark {
    width: 36px;
    height: 36px;
    border-radius: 12px;
  }

  .brand__logo {
    height: 24px;
  }

  .hero {
    padding-inline: 1rem;
  }

  .hero__content,
  .search-panel,
  .portal-card__body {
    padding: 1.2rem;
  }

  .hero h1 {
    font-size: 2.5rem;
  }

  .hero__cta {
    width: 100%;
  }

  .hero__logo {
    width: min(280px, 88%);
  }

  .hero__overlay::after {
    display: none;
  }
}
