/* =========================================================
   Contents (follows the order of index.html)
   1. Tokens & fonts
   2. Base
   3. Shared layout
   4. Header
   5. Hero
   6. About
   7. Published resources
   8. Releases
   9. Foundations and interoperability
  10. References
  11. Footer
  12. Responsive
  13. Reduced motion
   ========================================================= */


/* 1. Tokens & fonts
   --------------------------------------------------------- */

:root {
  color-scheme: light;

  /* Colour */
  --paper: #f7f7f2;
  --surface: #ffffff;
  --surface-soft: #eff2ec;
  --ink: #192b32;
  --ink-soft: #42565b;
  --muted: #687a7b;
  --line: #dce3dc;
  --teal: #176b63;
  --teal-dark: #10554f;
  --teal-pale: #dcece5;
  --gold: #c68a4a;

  /* Type */
  --font-body: Inter, "Avenir Next", Avenir, "Segoe UI", sans-serif;
  --font-serif: Georgia, "Times New Roman", serif;
  --font-display: "Bandal", sans-serif;

  /* Shape & layout */
  --radius: 5px;
  --content-width: 1120px;
  --page-gutter: clamp(1.25rem, 5vw, 4.5rem);
  --shadow-soft: 0 12px 34px rgb(25 43 50 / 5%);
}

@font-face {
  font-family: "Bandal";
  src: url("../fonts/bandal.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}


/* 2. Base
   --------------------------------------------------------- */

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 6rem;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

a:hover {
  color: var(--teal);
}

a:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 4px;
  border-radius: 2px;
}

::selection {
  background: var(--teal-pale);
  color: var(--ink);
}

h1,
h2,
h3 {
  margin-top: 0;
  font-weight: 550;
  letter-spacing: -0.04em;
}

h1 {
  max-width: 720px;
  margin-bottom: 1.5rem;
  font-family: var(--font-display);
  font-size: clamp(3.1rem, 6.5vw, 5.7rem);
  line-height: 1.02;
}

h2 {
  font-family: var(--font-serif);
  font-size: clamp(2.1rem, 4vw, 3.2rem);
  line-height: 1.15;
}

h3 {
  font-size: 1.3rem;
  line-height: 1.3;
}

p {
  margin-top: 0;
  color: var(--ink-soft);
}


/* 3. Shared layout
   --------------------------------------------------------- */

main,
.site-header,
.site-footer {
  width: min(100%, var(--content-width));
  margin-inline: auto;
}

.section {
  padding: clamp(4.5rem, 9vw, 7.5rem) var(--page-gutter);
}

.section-heading {
  max-width: 660px;
  margin-bottom: 3rem;
}

.section-heading h2 {
  margin-bottom: 0;
}

/* Status dot (hero) and release indicator (releases) */
.status-dot,
.release-indicator {
  display: inline-block;
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--teal);
}

/* Small uppercase labels (cards, panel, citations) */
.card-label,
.citation-label,
.panel-label {
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}


/* 4. Header
   --------------------------------------------------------- */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: 1.25rem var(--page-gutter);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 2.7rem;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2.7vw, 2rem);
}

.main-nav a {
  color: var(--ink-soft);
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 550;
  white-space: nowrap;
  transition: color 160ms ease;
}

.main-nav a:hover {
  color: var(--teal);
}

.main-nav .nav-external {
  padding: 0.55rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
}


/* 5. Hero
   --------------------------------------------------------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  align-items: center;
  gap: clamp(2rem, 5vw, 5rem);
  min-height: 540px;
  padding: clamp(4.5rem, 9vw, 7.5rem) var(--page-gutter) 1rem;
  overflow: hidden;
}

.hero-copy {
  position: relative;
  z-index: 1;
}

.hero-intro {
  max-width: 580px;
  margin-bottom: 2rem;
  font-size: clamp(1.02rem, 1.5vw, 1.14rem);
  line-height: 1.85;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  color: var(--muted);
  font-size: 0.76rem;
}

.hero-meta strong {
  color: var(--ink);
  font-weight: 750;
}

.meta-divider {
  margin-inline: 0.15rem;
  color: #a1b0a9;
}

.hero-visual {
  position: relative;
  width: 100%;
  max-width: 410px;
  aspect-ratio: 1;
  justify-self: center;
  isolation: isolate;
}

.hero-visual::before {
  position: absolute;
  z-index: -2;
  inset: 10%;
  border-radius: 50%;
  background:
    radial-gradient(
      circle at center,
      rgb(220 236 229 / 85%) 0,
      rgb(220 236 229 / 38%) 45%,
      transparent 72%
    );
  content: "";
}


/* 6. About
   --------------------------------------------------------- */

.about {
  margin-bottom: 4rem;
  padding: clamp(4.5rem, 9vw, 7.5rem) var(--page-gutter) 2rem;
}

.about p {
  text-align: justify;
  text-justify: inter-word;
}

.about a {
  border-bottom: 1px solid var(--teal);
  color: var(--teal);
  font-weight: 500;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.about a:hover {
  border-bottom-color: var(--gold);
  color: var(--gold);
}


/* 7. Published resources
   --------------------------------------------------------- */

.section-ontology {
  background: var(--surface-soft);
}

.resource-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.resource-card {
  display: flex;
  min-width: 0;
  min-height: 325px;
  flex-direction: column;
  align-items: flex-start;
  padding: calc(1.5rem - 2px) 1.5rem 1.5rem;
  border: 1px solid var(--line);
  border-top: 3px solid var(--teal);
  border-radius: var(--radius);
  background: var(--surface);
  transition:
    border-color 180ms ease,
    transform 180ms ease,
    box-shadow 180ms ease;
}

.resource-card:hover {
  transform: translateY(-3px);
  border-color: rgb(23 107 99 / 45%);
  box-shadow: var(--shadow-soft);
}

.resource-card h3 {
  margin-bottom: 0.65rem;
}

.resource-card > p {
  margin-bottom: 1.3rem;
  font-size: 0.88rem;
  line-height: 1.75;
}

.card-topline {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.card-version {
  padding: 0.18rem 0.45rem;
  border-radius: 3px;
  background: var(--teal-pale);
  color: var(--teal-dark);
  font-size: 0.68rem;
  font-weight: 750;
}

.card-icon {
  display: grid;
  width: 43px;
  height: 43px;
  place-items: center;
  margin-top: 1.6rem;
  margin-bottom: 1.2rem;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--teal);
  font-size: 1.2rem;
}

.card-icon-text {
  font-size: 0.9rem;
  font-weight: 750;
}

.card-link {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: auto;
  color: var(--teal);
  font-size: 0.87rem;
  font-weight: 700;
}

.card-link:hover {
  color: var(--teal-dark);
}

.format-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: auto;
}

.format-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.42rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--ink);
  font-size: 0.75rem;
  font-weight: 700;
}

.format-links a span {
  color: var(--muted);
  font-size: 0.61rem;
  font-weight: 500;
}

.format-links a:hover {
  border-color: var(--teal);
  color: var(--teal);
}


/* 8. Releases
   --------------------------------------------------------- */

.release-list {
  border-top: 1px solid var(--line);
}

.release-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: 1.6rem 0;
  border-bottom: 1px solid var(--line);
}

.release-version {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.release-indicator {
  width: 10px;
  height: 10px;
}

.release-indicator-old {
  background: #a8b4ad;
}

.release-version h3 {
  margin-bottom: 0.2rem;
  font-size: 1.1rem;
}

.release-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.release-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
}

.release-actions a {
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: rgb(255 255 255 / 50%);
  color: var(--ink-soft);
  font-size: 0.76rem;
  font-weight: 650;
}

.release-actions a:hover {
  border-color: var(--teal);
  color: var(--teal);
}


/* 9. Foundations and interoperability
   --------------------------------------------------------- */

.section-research {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.85fr);
  align-items: start;
  gap: clamp(2.5rem, 7vw, 6rem);
  background: #eef1eb;
}

.research-copy h2 {
  max-width: 520px;
}

.research-panel {
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.panel-label {
  margin-bottom: 1rem;
}

.research-panel ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.research-panel li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.83rem;
  font-weight: 650;
}

.alignment-tag {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 500;
  text-align: right;
}


/* 10. References
   --------------------------------------------------------- */

.citation-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  padding: clamp(4rem, 8vw, 6.5rem) var(--page-gutter);
}

.citation-section h2 {
  margin-bottom: 0;
}

.citation-card {
  width: 100%;
  max-width: 900px;
  padding: 1.75rem;
  border: 1px solid var(--line);
  border-left: 3px solid var(--teal);
  border-radius: var(--radius);
  background: var(--surface);
}

.citation-label {
  margin-bottom: 1rem;
}

.citation-text {
  margin-bottom: 1.2rem;
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 1.1rem;
  line-height: 1.7;
}

.doi-link {
  color: var(--teal);
  font-size: 0.82rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}


/* 11. Footer
   --------------------------------------------------------- */

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.5rem var(--page-gutter) 2rem;
}

.footer-brand {
  font-family: var(--font-display);
  font-size: 0.8rem;
}

.site-footer > p {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.1rem;
}

.footer-links a {
  color: var(--ink-soft);
  font-size: 0.78rem;
}

.footer-links a:hover {
  color: var(--teal);
}


/* 12. Responsive
   --------------------------------------------------------- */

@media (max-width: 850px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 2.5rem;
    padding-top: 4.5rem;
  }

  .hero-copy {
    max-width: 700px;
  }

  .hero-visual {
    width: min(100%, 360px);
  }

  .resource-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .resource-card:last-child {
    grid-column: 1 / -1;
    min-height: 250px;
  }

  .section-research {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 600px) {
  h1 {
    font-size: clamp(2.75rem, 12vw, 4rem);
  }

  .section {
    padding-top: 4rem;
    padding-bottom: 4rem;
  }

  /* Header */
  .site-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 1rem;
  }

  .main-nav {
    width: 100%;
    flex-wrap: wrap;
    gap: 0.65rem 1.1rem;
  }

  .main-nav a {
    font-size: 0.8rem;
  }

  .main-nav .nav-external {
    padding: 0.2rem 0.5rem;
  }

  /* Hero */
  .hero {
    min-height: auto;
    padding-top: 3.5rem;
    padding-bottom: 3.5rem;
  }

  .hero-intro {
    font-size: 1rem;
  }

  .hero-meta {
    line-height: 1.8;
  }

  /* Resources */
  .resource-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .resource-card,
  .resource-card:last-child {
    grid-column: auto;
    min-height: 280px;
  }

  /* Releases */
  .release-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 1rem;
  }

  .release-actions {
    justify-content: flex-start;
  }

  .release-actions a {
    font-size: 0.75rem;
  }

  /* Foundations */
  .research-panel {
    padding: 1.1rem;
  }

  .research-panel li {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.2rem;
  }

  .alignment-tag {
    text-align: left;
  }

  /* Footer */
  .site-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.7rem;
  }

  .footer-links {
    gap: 1rem;
  }
}


/* 13. Reduced motion
   --------------------------------------------------------- */

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