:root {
  --home-ink: #172922;
  --home-muted: #64736d;
  --home-faint: #93a09a;
  --home-green: #287967;
  --home-green-dark: #173f36;
  --home-green-soft: #e6f3ef;
  --home-bg: #f3f6f4;
  --home-surface: #ffffff;
  --home-line: #dde5e1;
  --home-danger: #bf554d;
  --home-danger-soft: #fbeceb;
  --home-warning: #b4781d;
  --home-warning-soft: #fff4dc;
  --home-info: #3e75aa;
  --home-info-soft: #eaf2fa;
  --home-violet: #715d9f;
  --home-shadow: 0 16px 45px rgba(26, 51, 42, 0.07);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background:
    radial-gradient(circle at 78% 0%, rgba(111, 175, 150, 0.13), transparent 27rem),
    var(--home-bg);
  color: var(--home-ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

button, textarea { font: inherit; }

button { cursor: pointer; }

.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;
}

.portal-header {
  position: sticky;
  z-index: 20;
  top: 0;
  border-bottom: 1px solid rgba(215, 227, 221, 0.85);
  background: rgba(250, 252, 251, 0.88);
  backdrop-filter: blur(18px);
}

.portal-header__inner {
  display: flex;
  align-items: center;
  width: min(1280px, calc(100% - 48px));
  min-height: 78px;
  margin: 0 auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand__mark {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
}

.brand__mark img { width: 46px; height: 46px; object-fit: contain; }

.brand strong {
  display: block;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.38rem;
  letter-spacing: -0.02em;
}

.brand small {
  display: block;
  margin-top: 1px;
  color: var(--home-muted);
  font-size: 0.69rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.portal-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.portal-nav a {
  padding: 10px 14px;
  border-radius: 999px;
  color: #52635c;
  font-size: 0.89rem;
  font-weight: 720;
  text-decoration: none;
  transition: 160ms ease;
}

.portal-nav a:hover { color: var(--home-ink); background: #edf3f0; }
.portal-nav a.active { color: var(--home-green-dark); background: var(--home-green-soft); }

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  margin-left: auto;
  padding: 10px;
  border: 1px solid var(--home-line);
  border-radius: 12px;
  background: var(--home-surface);
}

.nav-toggle > span:not(.sr-only) {
  display: block;
  height: 2px;
  margin: 4px 0;
  border-radius: 2px;
  background: var(--home-ink);
}

.portal-shell {
  width: min(1280px, calc(100% - 48px));
  margin: 0 auto;
  padding: 52px 0 80px;
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(430px, 0.72fr);
  gap: 72px;
  align-items: end;
  padding: 26px 0 50px;
}

.hero::before {
  position: absolute;
  z-index: -1;
  top: -8rem;
  left: -12rem;
  width: 32rem;
  height: 32rem;
  border: 1px solid rgba(53, 124, 105, 0.08);
  border-radius: 50%;
  content: "";
}

.hero__kicker, .section-kicker, .app-card__eyebrow {
  margin: 0 0 10px;
  color: var(--home-green);
  font-size: 0.7rem;
  font-weight: 850;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 760px;
  margin: 0;
  color: var(--home-ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.8rem, 5.1vw, 5.4rem);
  font-weight: 500;
  line-height: 0.98;
  letter-spacing: -0.048em;
}

.hero h1 span { color: var(--home-green); }

.hero__summary {
  max-width: 610px;
  margin: 22px 0 0;
  color: var(--home-muted);
  font-size: 1.04rem;
  line-height: 1.65;
}

.hero__pulse {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 10px;
}

.pulse-stat {
  min-height: 115px;
  padding: 20px;
  border: 1px solid rgba(218, 227, 222, 0.9);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.7);
  box-shadow: 0 12px 28px rgba(28, 58, 47, 0.04);
}

.pulse-stat--primary {
  grid-row: span 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 240px;
  border: 0;
  background: var(--home-green-dark);
  color: white;
  box-shadow: 0 24px 50px rgba(23, 63, 54, 0.2);
}

.pulse-stat span { display: block; color: var(--home-muted); font-size: 0.76rem; font-weight: 750; }
.pulse-stat strong { display: block; margin: 6px 0 2px; font-size: 2.1rem; line-height: 1; }
.pulse-stat small { color: var(--home-faint); font-size: 0.75rem; }
.pulse-stat--primary span, .pulse-stat--primary small { color: rgba(255,255,255,.7); }
.pulse-stat--primary strong { margin: 10px 0 13px; font-family: Georgia, serif; font-size: 5.6rem; font-weight: 500; }

.focus-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.58fr) minmax(340px, 0.72fr);
  gap: 18px;
  align-items: stretch;
}

.surface {
  border: 1px solid var(--home-line);
  border-radius: 24px;
  background: var(--home-surface);
  box-shadow: var(--home-shadow);
}

.attention-panel { padding: 26px; }
.note-panel { display: flex; flex-direction: column; padding: 24px; }

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

.section-heading--compact { align-items: center; margin-bottom: 14px; }
.section-heading h2 { margin: 0; font-family: Georgia, serif; font-size: 1.75rem; font-weight: 500; letter-spacing: -0.02em; }
.section-heading .section-kicker { margin-bottom: 5px; }
.updated { color: var(--home-faint); font-size: 0.74rem; font-weight: 650; white-space: nowrap; }

.action-list { display: grid; gap: 8px; }

.action-row {
  display: grid;
  grid-template-columns: 5px minmax(0, 1fr) auto 24px;
  gap: 14px;
  align-items: center;
  min-height: 68px;
  padding: 10px 14px 10px 5px;
  border: 1px solid #e7ece9;
  border-radius: 15px;
  text-decoration: none;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.action-row:hover { transform: translateY(-1px); border-color: #cfdcd6; box-shadow: 0 8px 20px rgba(28, 58, 47, .06); }
.action-row__indicator { align-self: stretch; border-radius: 10px; background: var(--home-warning); }
.action-row--danger .action-row__indicator { background: var(--home-danger); }
.action-row--info .action-row__indicator { background: var(--home-info); }
.action-row__copy strong { display: block; font-size: 0.92rem; }
.action-row__copy small { display: block; margin-top: 4px; color: var(--home-muted); font-size: 0.76rem; }
.action-row__count { min-width: 34px; text-align: right; font-family: Georgia, serif; font-size: 1.55rem; }
.action-row__arrow { color: var(--home-faint); font-size: 1.1rem; }

.all-clear { display: flex; gap: 14px; align-items: center; min-height: 130px; padding: 24px; border-radius: 18px; background: var(--home-green-soft); }
.all-clear__icon { display: grid; width: 46px; height: 46px; place-items: center; border-radius: 50%; background: var(--home-green); color: #fff; font-size: 1.3rem; }
.all-clear p { margin: 5px 0 0; color: var(--home-muted); }

.note-count {
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  border-radius: 50%;
  background: var(--home-green-soft);
  color: var(--home-green-dark);
  font-size: .78rem;
  font-weight: 800;
}

.note-form textarea {
  width: 100%;
  min-height: 86px;
  padding: 13px 14px;
  resize: vertical;
  border: 1px solid var(--home-line);
  border-radius: 14px;
  outline: 0;
  color: var(--home-ink);
  background: #f8faf9;
  font-size: .86rem;
  line-height: 1.5;
}

.note-form textarea:focus { border-color: #7fb4a5; box-shadow: 0 0 0 3px rgba(40,121,103,.1); }
.note-form__footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 9px 0 13px; }
.note-form button {
  min-height: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: 10px;
  background: var(--home-green);
  color: #fff;
  font-size: .76rem;
  font-weight: 800;
}
.note-form button:hover { background: var(--home-green-dark); }
.note-form button:disabled { opacity: .55; cursor: wait; }
.form-message { color: var(--home-green); font-size: .72rem; }
.form-message.is-error { color: var(--home-danger); }

.note-list { display: grid; gap: 7px; max-height: 205px; overflow: auto; padding-right: 2px; }
.note-item { padding: 10px 11px; border: 1px solid #e6ebe8; border-radius: 12px; background: #fbfcfb; }
.note-item p { margin: 0; color: #384b43; font-size: .78rem; line-height: 1.42; white-space: pre-wrap; overflow-wrap: anywhere; }
.note-item > div { display: flex; justify-content: space-between; align-items: center; margin-top: 7px; }
.note-item time { color: var(--home-faint); font-size: .66rem; }
.note-item button { padding: 2px 5px; border: 0; background: none; color: var(--home-faint); font-size: .66rem; font-weight: 700; }
.note-item button:hover { color: var(--home-danger); }
.note-empty { padding: 18px 10px; color: var(--home-faint); font-size: .78rem; line-height: 1.45; text-align: center; }

.apps-section { margin-top: 56px; }
.apps-heading { align-items: end; margin-bottom: 18px; }
.apps-heading > p { max-width: 350px; margin: 0; color: var(--home-muted); font-size: .8rem; text-align: right; }

.app-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
}

.app-card {
  position: relative;
  grid-column: span 2;
  display: flex;
  flex-direction: column;
  min-height: 345px;
  padding: 22px;
  overflow: hidden;
  border: 1px solid var(--home-line);
  border-radius: 22px;
  background: var(--home-surface);
  box-shadow: 0 9px 26px rgba(27, 54, 44, .045);
  text-decoration: none;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.app-card:nth-child(4), .app-card:nth-child(5) { grid-column: span 3; min-height: 320px; }
.app-card::after { position: absolute; top: -65px; right: -60px; width: 155px; height: 155px; border-radius: 50%; background: var(--card-soft, var(--home-green-soft)); content: ""; opacity: .75; }
.app-card:hover { transform: translateY(-4px); border-color: #c5d6ce; box-shadow: 0 20px 42px rgba(24, 53, 43, .1); }
.app-card--todo { --card-accent: #287967; --card-soft: #e4f3ee; }
.app-card--c57 { --card-accent: #9b6b24; --card-soft: #fbf0dc; }
.app-card--transgenic { --card-accent: #705896; --card-soft: #eee9f5; }
.app-card--ontarget { --card-accent: #3b6f9e; --card-soft: #e7f0f8; }
.app-card--tools { --card-accent: #277a76; --card-soft: #e3f2f1; }
.app-card--unavailable { --card-accent: #8b9290; --card-soft: #f0f1f1; }

.app-card__top { position: relative; z-index: 1; display: flex; justify-content: space-between; align-items: center; }
.app-icon { display: grid; width: 44px; height: 44px; place-items: center; border-radius: 13px; background: var(--card-soft); color: var(--card-accent); }
.app-icon svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.app-status { display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px; border-radius: 999px; background: #eef6f3; color: #367260; font-size: .65rem; font-weight: 800; }
.app-status i { width: 6px; height: 6px; border-radius: 50%; background: #40987f; }
.app-status--attention { background: var(--home-warning-soft); color: #875b17; }
.app-status--attention i { background: var(--home-warning); }
.app-status--error { background: var(--home-danger-soft); color: #9d443e; }
.app-status--error i { background: var(--home-danger); }

.app-card__eyebrow { margin-top: 24px; margin-bottom: 6px; color: var(--card-accent); }
.app-card h3 { margin: 0; font-family: Georgia, serif; font-size: 1.75rem; font-weight: 500; letter-spacing: -.025em; }
.app-card__description { min-height: 42px; margin: 9px 0 17px; color: var(--home-muted); font-size: .8rem; line-height: 1.5; }
.app-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.app-metric { min-width: 0; padding: 10px; border-radius: 12px; background: #f6f8f7; }
.app-metric strong { display: block; overflow: hidden; color: var(--home-ink); font-size: 1.12rem; line-height: 1.15; text-overflow: ellipsis; }
.app-metric span { display: block; margin-top: 4px; color: var(--home-faint); font-size: .63rem; font-weight: 700; }
.app-metric--red { background: var(--home-danger-soft); }
.app-metric--amber { background: var(--home-warning-soft); }
.app-metric--blue { background: var(--home-info-soft); }
.app-metric--teal { background: var(--home-green-soft); }
.app-metric--violet { background: #f0ecf7; }
.app-error { padding: 10px; border-radius: 12px; background: var(--home-danger-soft); color: #91463f; font-size: .7rem; line-height: 1.4; overflow-wrap: anywhere; }
.app-card__open { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 17px; color: var(--card-accent); font-size: .72rem; font-weight: 800; }
.app-card__open b { font-size: 1rem; }

.moments {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 410px);
  gap: 42px;
  min-height: 520px;
  margin-top: 18px;
  padding: 28px 38px;
  border: 1px solid #e2ddd5;
  border-radius: 24px;
  background: linear-gradient(135deg, #f5efe8 0%, #eef4f1 100%);
  box-shadow: var(--home-shadow);
}

.moments__intro {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 30px 24px;
}

.moments__intro h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  max-width: 480px;
  font-size: clamp(2.4rem, 4vw, 4.6rem);
  font-weight: 500;
  letter-spacing: -.025em;
}

.moments__intro > p:not(.section-kicker) {
  max-width: 390px;
  margin: 18px 0 0;
  color: var(--home-muted);
  font-size: .94rem;
  line-height: 1.7;
}

.carousel-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 34px;
}

.carousel-controls button {
  display: grid;
  width: 34px;
  height: 34px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(71, 88, 80, .16);
  border-radius: 50%;
  background: rgba(255,255,255,.72);
  color: var(--home-green-dark);
  font-weight: 800;
}

.carousel-controls button:hover { background: #fff; border-color: rgba(40,121,103,.35); }
.carousel-controls span { color: var(--home-faint); font-size: .72rem; font-weight: 700; }
.carousel-controls b { color: var(--home-ink); }

.photo-carousel {
  position: relative;
  align-self: center;
  justify-self: end;
  width: min(100%, 390px);
  min-width: 0;
  height: auto;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: 18px;
  background: #dfe7e2;
  box-shadow: 0 18px 38px rgba(41, 55, 48, .13);
}

.photo-slide {
  position: absolute;
  inset: 0;
  z-index: 0;
  margin: 0;
  opacity: 0;
  pointer-events: none;
  transform: translate3d(2.5%, 0, 0) scale(.985);
  transition:
    opacity 760ms cubic-bezier(.22, .61, .36, 1),
    transform 920ms cubic-bezier(.22, .61, .36, 1);
  will-change: opacity, transform;
}

.photo-slide.is-active {
  z-index: 1;
  opacity: 1;
  pointer-events: auto;
  transform: translate3d(0, 0, 0) scale(1);
}

.photo-slide__backdrop {
  position: absolute;
  inset: -28px;
  background-position: center;
  background-size: cover;
  filter: blur(24px) saturate(1.05);
  opacity: .46;
  transform: scale(1.08);
  transition: transform 6200ms ease-out;
  will-change: transform;
}

.photo-slide.is-active .photo-slide__backdrop { transform: scale(1.14); }

.photo-slide::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(232,238,234,.28), transparent 12%, transparent 88%, rgba(232,238,234,.28));
  content: "";
  pointer-events: none;
}

.photo-slide img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  padding: 8px;
  filter: drop-shadow(0 12px 24px rgba(31, 45, 38, .14));
  transform: scale(1.025);
  transition: transform 6200ms ease-out;
  will-change: transform;
}

.photo-slide.is-active img { transform: scale(1); }

.photo-carousel--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 14px;
  padding: 34px 28px;
  border: 1px dashed rgba(58, 102, 86, .24);
  background: rgba(255,255,255,.48);
  box-shadow: none;
  text-align: center;
}

.photo-carousel--empty img { width: 92px; height: 92px; object-fit: contain; opacity: .72; }
.photo-carousel--empty strong { display: block; font-family: Georgia, serif; font-size: 1.2rem; font-weight: 500; }
.photo-carousel--empty p { max-width: 280px; margin: 7px 0 0; color: var(--home-muted); font-size: .76rem; line-height: 1.5; }
.photo-carousel--empty code { padding: 2px 5px; border-radius: 5px; background: rgba(255,255,255,.72); color: var(--home-green-dark); }

.portal-footer {
  display: flex;
  justify-content: space-between;
  width: min(1280px, calc(100% - 48px));
  margin: 0 auto;
  padding: 20px 0 34px;
  border-top: 1px solid var(--home-line);
  color: var(--home-faint);
  font-size: .72rem;
}

.portal-footer button { padding: 0; border: 0; background: none; color: var(--home-green); font-size: .72rem; font-weight: 750; }

@media (max-width: 1040px) {
  .hero { grid-template-columns: 1fr; gap: 34px; }
  .hero__pulse { grid-template-columns: 1.3fr 1fr 1fr; }
  .pulse-stat--primary { grid-row: auto; min-height: 140px; }
  .pulse-stat--primary strong { font-size: 3.8rem; }
  .pulse-stat { min-height: 140px; }
  .focus-grid { grid-template-columns: 1fr; }
  .moments { grid-template-columns: minmax(0, 1fr) minmax(280px, 360px); gap: 24px; padding: 24px; }
  .note-list { max-height: 230px; }
  .app-card { grid-column: span 3; }
  .app-card:nth-child(5) { grid-column: 2 / span 4; }
}

@media (max-width: 820px) {
  .portal-header__inner, .portal-shell, .portal-footer { width: min(100% - 30px, 1280px); }
  .portal-header__inner { min-height: 68px; }
  .brand small { display: none; }
  .nav-toggle { display: block; }
  .portal-nav {
    position: absolute;
    top: 60px;
    right: 15px;
    left: 15px;
    display: none;
    grid-template-columns: repeat(2, 1fr);
    gap: 4px;
    padding: 10px;
    border: 1px solid var(--home-line);
    border-radius: 16px;
    background: rgba(255,255,255,.97);
    box-shadow: var(--home-shadow);
  }
  .portal-nav.is-open { display: grid; }
  .portal-nav a { text-align: center; }
  .portal-shell { padding-top: 24px; }
  .hero { padding-bottom: 38px; }
  .hero__pulse { grid-template-columns: 1fr 1fr; }
  .pulse-stat--primary { grid-column: span 2; }
  .moments { grid-template-columns: 1fr; }
  .moments__intro { align-items: center; padding: 18px 8px 4px; text-align: center; }
  .moments__intro > p:not(.section-kicker) { max-width: none; }
  .carousel-controls { margin-top: 16px; }
  .photo-carousel { justify-self: center; width: min(100%, 370px); height: auto; }
  .app-card, .app-card:nth-child(4), .app-card:nth-child(5) { grid-column: span 6; min-height: 315px; }
  .apps-heading > p { display: none; }
}

@media (max-width: 560px) {
  .portal-header__inner, .portal-shell, .portal-footer { width: calc(100% - 24px); }
  .brand__mark, .brand__mark img { width: 40px; height: 40px; }
  .brand strong { font-size: 1.2rem; }
  .hero h1 { font-size: clamp(2.5rem, 13vw, 4rem); }
  .hero__summary { font-size: .93rem; }
  .hero__pulse { grid-template-columns: 1fr 1fr; }
  .pulse-stat--primary { min-height: 128px; }
  .pulse-stat { min-height: 105px; padding: 16px; }
  .pulse-stat--primary strong { font-size: 3.3rem; }
  .attention-panel, .note-panel { padding: 18px; border-radius: 20px; }
  .moments { padding: 12px; border-radius: 20px; }
  .moments__intro h2 { font-size: 2.45rem; }
  .photo-carousel { width: 100%; height: auto; aspect-ratio: 4 / 5; }
  .photo-carousel--empty { flex-direction: column; gap: 10px; padding: 24px 18px; text-align: center; }
  .photo-carousel--empty img { width: 72px; height: 72px; }
  .section-heading { align-items: flex-start; }
  .updated { margin-top: 7px; }
  .action-row { grid-template-columns: 4px minmax(0,1fr) auto; gap: 10px; }
  .action-row__arrow { display: none; }
  .action-row__copy small { display: none; }
  .apps-section { margin-top: 42px; }
  .app-card { padding: 19px; }
  .portal-footer { align-items: center; }
}

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

  .photo-slide {
    transform: none !important;
    transition: opacity 240ms ease !important;
  }

  .photo-slide__backdrop,
  .photo-slide.is-active .photo-slide__backdrop {
    transform: scale(1.1);
  }

  .photo-slide img,
  .photo-slide.is-active img {
    transform: none;
  }
}
