/* Harte Research Institute, concept redesign prototype by Stoa
   Self-contained. System fonts only. WCAG 2.1 AA palette. */

:root {
  --ocean:        #0b3d5c;  /* deep gulf blue */
  --ocean-700:    #08293d;
  --ocean-900:    #051a28;
  --teal:         #1d7a8c;  /* secondary accent */
  --coral:        #c14a28;  /* AA on white for text + white-on-coral buttons (4.9:1) */
  --coral-soft:   #e1623d;  /* decorative only, never small text on white */
  --sand:         #f6f1e7;
  --sand-200:     #ece3d2;
  --ink:          #16242c;
  --muted:        #475a64;  /* 7:1 on white */
  --paper:        #ffffff;
  --line:         #ddd4c2;
  --focus:        #0b3d5c;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
}
h1, h2, h3, h4 { line-height: 1.15; color: var(--ocean); margin: 0 0 .5rem; }
h1 { font-size: clamp(2rem, 5vw, 3.25rem); letter-spacing: -.01em; }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1rem; }
a { color: var(--ocean); text-underline-offset: 3px; }
a:hover { color: var(--coral); }

/* Visible focus everywhere */
a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--coral);
  outline-offset: 2px;
  border-radius: 2px;
}

.wrap { max-width: 1160px; margin: 0 auto; padding: 0 5vw; }
.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;
}
.skip {
  position: absolute; left: -999px; top: 0; z-index: 50;
}
.skip:focus {
  left: 1rem; top: 1rem; background: #fff; color: var(--ocean);
  padding: .6rem 1rem; font-weight: 700; outline: 3px solid var(--coral);
}

/* ---- Prototype banner ---- */
.proto-banner {
  background: var(--ocean-900); color: #dcebf2;
  font-size: .82rem; line-height: 1.5;
  padding: .55rem 5vw; text-align: center;
}
.proto-banner strong { color: #ffd27a; }
.proto-banner a { color: #9fd0e6; }

/* ---- Utility bar ---- */
.util-bar {
  background: var(--ocean-700); color: #cfe0ea;
  font-size: .8rem;
}
.util-bar .wrap {
  display: flex; flex-wrap: wrap; gap: .5rem 1.25rem;
  justify-content: space-between; align-items: center;
  padding-top: .5rem; padding-bottom: .5rem;
}
.util-bar a { color: #cfe0ea; }
.util-bar a:hover { color: #fff; }
.util-bar .util-links { display: flex; flex-wrap: wrap; gap: .25rem .9rem; }

/* ---- Header / brand ---- */
.site-header { border-bottom: 1px solid var(--line); background: var(--paper); }
.brand-row {
  display: flex; align-items: center; gap: 1rem;
  padding-top: 1.1rem; padding-bottom: 1.1rem;
}
.brand-mark { flex: 0 0 auto; }
.brand-text .pre {
  font-size: .72rem; text-transform: uppercase; letter-spacing: .14em;
  color: var(--coral); font-weight: 700; margin: 0;
}
.brand-text .name {
  font-size: clamp(1.05rem, 2.4vw, 1.4rem); font-weight: 800;
  color: var(--ocean); letter-spacing: .01em; margin: 0; line-height: 1.1;
}
.brand-text .sub { font-size: .85rem; color: var(--muted); margin: .15rem 0 0; }

/* ---- Primary nav ---- */
.primary-nav { background: var(--ocean); }
.primary-nav .wrap { padding: 0 5vw; }
.nav-toggle {
  display: none; background: none; border: 0; color: #fff;
  font: inherit; font-weight: 600; padding: .85rem 0; cursor: pointer;
  align-items: center; gap: .5rem;
}
.nav-list {
  display: flex; flex-wrap: wrap; gap: 0; list-style: none; margin: 0; padding: 0;
}
.nav-list a {
  display: block; color: #eaf3f8; text-decoration: none;
  font-weight: 600; font-size: .95rem; padding: .9rem 1rem;
}
.nav-list a:hover { background: var(--ocean-700); color: #fff; }
.nav-list a[aria-current="page"] {
  color: #fff; box-shadow: inset 0 -4px 0 var(--coral-soft);
}

/* ---- Hero ---- */
.hero {
  position: relative; overflow: hidden;
  background: linear-gradient(165deg, var(--ocean) 0%, var(--ocean-900) 100%);
  color: #fff;
}
.hero .wrap { position: relative; z-index: 2; padding-top: 4.5rem; padding-bottom: 5rem; }
.hero-grid { display: grid; grid-template-columns: minmax(0,1.6fr) minmax(0,1fr); gap: 3rem; align-items: center; }
.hero .eyebrow {
  font-size: .8rem; text-transform: uppercase; letter-spacing: .18em;
  color: #ffd27a; font-weight: 700; margin: 0 0 .75rem;
}
.hero h1 { color: #fff; max-width: 18ch; }
.hero p.lede { font-size: 1.15rem; color: #d7e7f0; max-width: 50ch; margin-top: 1rem; }
.hero-wave { position: absolute; left: 0; right: 0; bottom: -1px; z-index: 1; display: block; width: 100%; height: auto; }
.hero-card {
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.22);
  border-radius: 12px; padding: 1.5rem; backdrop-filter: blur(2px);
}
.hero-card h2 { color: #ffd27a; font-size: 1.05rem; margin-bottom: .75rem; }
.hero-card ul { margin: 0; padding-left: 1.1rem; color: #e6f1f7; font-size: .95rem; }
.hero-card li { margin-bottom: .4rem; }

/* ---- Buttons ---- */
.btn {
  display: inline-block; font-weight: 700; font-size: .95rem;
  padding: .8rem 1.5rem; border-radius: 6px; text-decoration: none;
  border: 2px solid transparent; cursor: pointer;
}
.btn-primary { background: var(--coral); color: #fff; border-color: var(--coral); }
.btn-primary:hover { background: #a23d1f; color: #fff; }
.btn-ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.6); }
.btn-ghost:hover { border-color: #fff; color: #fff; }
.btn-row { margin-top: 1.8rem; display: flex; flex-wrap: wrap; gap: .75rem; }

/* ---- Sections ---- */
.section { padding: 4rem 0; }
.section--sand { background: var(--sand); }
.section--ocean { background: var(--ocean-700); color: #e6f1f7; }
.section--ocean h2 { color: #ffd27a; }
.eyebrow {
  font-size: .8rem; text-transform: uppercase; letter-spacing: .16em;
  color: var(--coral); font-weight: 700; margin: 0 0 .5rem;
}
.section-intro { max-width: 60ch; color: var(--muted); }
.section--ocean .section-intro { color: #cfe0ea; }
.section--ocean .eyebrow { color: #ffd27a; }

/* ---- Card grid ---- */
.grid { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); margin-top: 2rem; }
.card {
  background: var(--paper); border: 1px solid var(--line); border-radius: 10px;
  overflow: hidden; display: flex; flex-direction: column;
  box-shadow: 0 2px 12px rgba(11,61,92,.08);
}
.card .thumb { width: 100%; height: 150px; display: block; }
.card .body { padding: 1.2rem 1.3rem 1.4rem; flex: 1; display: flex; flex-direction: column; }
.tag {
  font-size: .72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--coral);
}
.card h3 { margin: .4rem 0 .5rem; }
.card p { color: var(--muted); font-size: .95rem; margin-bottom: 1rem; }
.card .more { margin-top: auto; font-weight: 600; font-size: .9rem; text-decoration: none; }

/* ---- Quick links ---- */
.linklist { list-style: none; margin: 2rem 0 0; padding: 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(15rem,1fr)); }
.linklist a {
  display: block; background: var(--paper); border: 1px solid var(--line);
  border-left: 4px solid var(--ocean); border-radius: 4px;
  padding: 1.1rem 1.25rem; text-decoration: none; color: var(--ink); height: 100%;
}
.linklist a:hover { border-left-color: var(--coral); }
.linklist strong { display: block; color: var(--ocean); margin-bottom: .25rem; }
.linklist span { display: block; font-size: .9rem; color: var(--muted); }

/* ---- Reviewer note ---- */
.reviewer-note {
  background: #fff7ec; border: 1px solid #f0d9a8; border-left: 4px solid #d99b1c;
  border-radius: 6px; padding: 1rem 1.25rem; margin: 2rem 0; font-size: .92rem; color: #5b4408;
}
.reviewer-note strong { color: #7a5a00; }
.reviewer-note p:last-child { margin-bottom: 0; }

/* ---- Network table ---- */
.table-scroll { overflow-x: auto; margin-top: 2rem; }
table.net { width: 100%; border-collapse: collapse; font-size: .95rem; background: #fff; }
table.net caption { text-align: left; color: var(--muted); font-size: .9rem; margin-bottom: .75rem; }
table.net th, table.net td { text-align: left; padding: .8rem 1rem; border-bottom: 1px solid var(--line); vertical-align: top; }
table.net thead th { background: var(--ocean); color: #fff; font-size: .85rem; text-transform: uppercase; letter-spacing: .05em; }
table.net tbody tr:hover { background: var(--sand); }
.pill { display: inline-block; font-size: .72rem; font-weight: 700; padding: .15rem .55rem; border-radius: 999px; }
.pill--drupal { background: #e7f0f5; color: #0b3d5c; }
.pill--decap { background: #fbe7df; color: #8a3414; }
.pill--static { background: #ece3d2; color: #5b4408; }

/* ---- Search demo ---- */
.search-shell { margin-top: 1.5rem; }
.search-field { position: relative; }
.search-field input[type="search"] {
  width: 100%; font: inherit; font-size: 1.1rem; padding: 1rem 1rem 1rem 3rem;
  border: 2px solid var(--ocean); border-radius: 8px; background: #fff;
}
.search-field svg { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); }
.facets { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1.25rem 0 .5rem; }
.facet {
  font: inherit; font-size: .85rem; font-weight: 600; cursor: pointer;
  background: #fff; border: 1.5px solid var(--line); color: var(--ink);
  padding: .4rem .9rem; border-radius: 999px;
}
.facet[aria-pressed="true"] { background: var(--ocean); color: #fff; border-color: var(--ocean); }
.search-meta { color: var(--muted); font-size: .9rem; margin: 1rem 0; }
.results { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; }
.result {
  background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--ocean);
  border-radius: 6px; padding: 1.1rem 1.25rem;
}
.result h3 { margin: 0 0 .3rem; font-size: 1.1rem; }
.result h3 a { text-decoration: none; }
.result .rtype { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--coral); }
.result p { margin: .4rem 0 .5rem; color: var(--muted); font-size: .95rem; }
.result .src { font-size: .82rem; color: var(--muted); }
.result mark { background: #ffe9a8; color: inherit; padding: 0 .1em; border-radius: 2px; }
.no-results { background: var(--sand); border: 1px dashed var(--line); border-radius: 8px; padding: 2rem; text-align: center; color: var(--muted); }

/* ---- Forms (contact) ---- */
.form-grid { display: grid; gap: 1.25rem; max-width: 38rem; }
.field label { display: block; font-weight: 600; margin-bottom: .35rem; }
.field input, .field select, .field textarea {
  width: 100%; font: inherit; padding: .7rem .85rem;
  border: 1.5px solid var(--line); border-radius: 6px; background: #fff;
}
.field .hint { font-size: .82rem; color: var(--muted); margin-top: .3rem; }
.contact-grid { display: grid; gap: 2.5rem; grid-template-columns: minmax(0,1.3fr) minmax(0,1fr); align-items: start; }
.info-card { background: var(--sand); border: 1px solid var(--line); border-radius: 10px; padding: 1.5rem; }
.info-card h3 { margin-top: 0; }
.status { margin-top: 1rem; padding: 1rem; border-radius: 6px; background: #e7f3ec; border: 1px solid #b8ddc4; color: #1d5132; }

/* ---- Footer ---- */
.site-footer { background: var(--ocean-900); color: #cfe0ea; padding: 3rem 0 2rem; margin-top: 0; }
.footer-grid { display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(13rem,1fr)); }
.site-footer h3 { color: #ffd27a; font-size: 1rem; margin-bottom: .6rem; }
.site-footer a { color: #cfe0ea; }
.site-footer a:hover { color: #fff; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: .4rem; }
.footer-legal {
  border-top: 1px solid rgba(255,255,255,.15); margin-top: 2.5rem; padding-top: 1.25rem;
  display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; justify-content: space-between;
  font-size: .82rem; color: #9fb6c4;
}

/* ---- Responsive ---- */
@media (max-width: 860px) {
  .hero-grid, .contact-grid { grid-template-columns: 1fr; }
  .hero .wrap { padding-top: 3rem; padding-bottom: 3.5rem; }
}
@media (max-width: 720px) {
  .nav-toggle { display: flex; }
  .nav-list {
    flex-direction: column; gap: 0;
    max-height: 0; overflow: hidden; transition: max-height .25s ease;
  }
  .nav-list.open { max-height: 30rem; padding-bottom: .5rem; }
  .nav-list a { padding: .8rem .25rem; border-top: 1px solid rgba(255,255,255,.12); }
  .util-bar .wrap { justify-content: center; }
}

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