:root {
  --navy: #002d6a;
  --navy-deep: #142b4b;
  --blue: #315f93;
  --blue-light: #edf3fa;
  --cream: #f6f8fb;
  --text: #213852;
  --muted: #5e718a;
  --border: #dbe3ed;
  --white: #fff;
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body {
  background: var(--cream);
  color: var(--text);
  font-family: "DM Sans", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a:focus-visible, iframe:focus-visible {
  outline: 3px solid #527da9;
  outline-offset: 3px;
}

.app-header {
  min-height: 82px;
  padding: 16px clamp(18px, 4vw, 42px);
  display: flex;
  align-items: center;
  gap: 20px;
  background: var(--white);
  border-bottom: 1px solid var(--border);
}

.app-brand { min-width: 0; }
.app-eyebrow {
  margin-bottom: 5px;
  color: var(--blue);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.app-title {
  margin: 0;
  color: var(--navy);
  font-family: "DM Serif Display", Georgia, serif;
  font-size: clamp(1.35rem, 3vw, 2rem);
  font-weight: 400;
  line-height: 1.1;
}

.header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 9px;
  flex-shrink: 0;
}

.button {
  min-height: 42px;
  padding: 10px 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--white);
  color: var(--navy);
  font-size: 0.86rem;
  font-weight: 700;
  text-decoration: none;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}
.button:hover { background: var(--blue-light); border-color: #b7c9dd; }
.button-primary { background: var(--navy); border-color: var(--navy); color: var(--white); }
.button-primary:hover { background: #0e477f; border-color: #0e477f; }

.embed-page { min-height: 100vh; display: flex; flex-direction: column; }
.embed-note {
  padding: 10px clamp(18px, 4vw, 42px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  background: var(--blue-light);
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.5;
}
.embed-note a { color: var(--blue); font-weight: 700; }
.frame-wrap { position: relative; flex: 1; min-height: 680px; padding: 14px; }
.frame-loader {
  position: absolute;
  inset: 14px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--white);
  color: var(--muted);
  font-size: 0.95rem;
}
.app-frame {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: calc(100vh - 139px);
  min-height: 650px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--white);
  box-shadow: 0 8px 30px rgba(0, 45, 106, 0.08);
}

.library-main { max-width: 1180px; margin: 0 auto; padding: 48px 24px 80px; }
.library-intro { max-width: 720px; margin-bottom: 38px; }
.library-intro h1 {
  margin: 0 0 13px;
  color: var(--navy);
  font-family: "DM Serif Display", Georgia, serif;
  font-size: clamp(2.2rem, 6vw, 4.4rem);
  font-weight: 400;
  letter-spacing: -0.035em;
  line-height: 1.02;
}
.library-intro h1 em { color: var(--blue); font-style: italic; }
.library-intro p { margin: 0; color: var(--muted); font-size: 1rem; line-height: 1.75; }
.section-heading { margin: 36px 0 17px; display: flex; align-items: end; justify-content: space-between; gap: 18px; }
.section-kicker { color: var(--blue); font-size: 0.68rem; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; }
.section-heading h2 { margin: 5px 0 0; color: var(--navy); font-family: "DM Serif Display", Georgia, serif; font-size: 1.7rem; font-weight: 400; }
.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.page-card {
  min-height: 220px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: var(--white);
  color: var(--text);
  text-decoration: none;
  box-shadow: 0 5px 20px rgba(0, 45, 106, 0.045);
  transition: transform 170ms ease, box-shadow 170ms ease, border-color 170ms ease;
}
.page-card:hover { transform: translateY(-3px); border-color: #a9bfd7; box-shadow: 0 12px 30px rgba(0, 45, 106, 0.09); }
.card-icon { width: 45px; height: 45px; display: grid; place-items: center; border-radius: 12px; background: var(--blue-light); font-size: 1.35rem; }
.card-type { color: var(--blue); font-size: 0.67rem; font-weight: 700; letter-spacing: 0.13em; text-transform: uppercase; }
.page-card h3 { margin: 0; color: var(--navy); font-family: "DM Serif Display", Georgia, serif; font-size: 1.35rem; font-weight: 400; line-height: 1.22; }
.page-card p { margin: 0; color: var(--muted); font-size: 0.9rem; line-height: 1.65; }
.card-link { margin-top: auto; color: var(--blue); font-size: 0.82rem; font-weight: 700; }
.library-footer { margin-top: 46px; padding-top: 22px; border-top: 1px solid var(--border); color: var(--muted); font-size: 0.82rem; }

@media (max-width: 900px) { .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 660px) {
  .app-header { min-height: 72px; padding: 12px 15px; gap: 12px; }
  .app-eyebrow { font-size: 0.6rem; letter-spacing: 0.1em; }
  .app-title { font-size: 1.12rem; }
  .embed-page .header-actions .button:first-child { display: none; }
  .button { min-height: 40px; padding: 9px 11px; font-size: 0.78rem; }
  .embed-note { padding: 9px 15px; font-size: 0.78rem; }
  .embed-note span { display: none; }
  .frame-wrap { min-height: 580px; padding: 7px; }
  .frame-loader { inset: 7px; }
  .app-frame { height: calc(100vh - 119px); min-height: 560px; border-radius: 9px; }
  .library-main { padding: 34px 17px 60px; }
  .library-intro { margin-bottom: 30px; }
  .library-intro h1 { font-size: 2.65rem; }
  .card-grid { grid-template-columns: 1fr; gap: 12px; }
  .page-card { min-height: 0; padding: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
