/* =========================================================
   BRAND SYSTEM
   One palette, two surfaces:
   - Light (default): the reading surface for all content.
   - Dark (.theme-dark): the frame. Header, page heroes,
     the closing strip and the footer.
   The navy of the dark surface is the ink on the light one,
   and the off-white of the light surface is the ink on the
   dark one. Copper is the only accent on both.
   ========================================================= */

:root {
  /* Brand constants */
  --navy: #14242e;
  --navy-deep: #0d171e;
  --paper: #f4f2ee;
  --copper: #c56f45;

  /* Light surface tokens */
  --bg: var(--paper);
  --bg-soft: #ffffff;
  --bg-raised: #ebe8e2;

  --text: #33444c;
  --text-strong: var(--navy);
  --muted: #5f747b;

  --accent: #a4532e;               /* copper, darkened for text contrast on paper */
  --accent-bright: #c56f45;        /* rules, dots, decorative copper */
  --button-bg: #a4532e;
  --button-bg-hover: #8c4526;
  --button-ink: #ffffff;

  --steel: #3f6470;                /* overlines, card titles */

  --border: #dcd7ce;
  --line: #e4e0d8;

  --shadow: 0 14px 34px rgba(20, 36, 46, 0.10);

  /* Type */
  --font-head: "Poppins", "Segoe UI", Helvetica, Arial, sans-serif;
  --font-sans: "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --space-xs: 0.5rem;
  --space-s: 1rem;
  --space-m: 2rem;
  --space-l: 4rem;

  --container-pad: 8%;
  --radius-s: 8px;
  --radius-m: 12px;
}

/* Dark frame: same variable names, dark values */
.theme-dark {
  --bg: var(--navy);
  --bg-soft: rgba(255, 255, 255, 0.045);
  --bg-raised: #1a2e3a;

  --text: #cfdadd;
  --text-strong: #f2f5f5;
  --muted: #8fa6ad;

  --accent: #d0845a;
  --accent-bright: #d0845a;
  --button-bg: #d0845a;
  --button-bg-hover: #e0996f;
  --button-ink: var(--navy);

  --steel: #8fb3bd;

  --border: rgba(159, 180, 187, 0.22);
  --line: rgba(159, 180, 187, 0.14);

  --shadow: 0 18px 40px rgba(0, 0, 0, 0.45);

  background-color: var(--bg);
  color: var(--text);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--paper);
}

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--text);
  line-height: 1.65;
  background: var(--bg);
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-head);
  font-weight: 600;
  color: var(--text-strong);
  line-height: 1.2;
}

strong {
  color: var(--text-strong);
  font-weight: 600;
}

::selection {
  background: var(--copper);
  color: #fff;
}

/* Copper highlight for the key word in a headline */
.hl {
  color: var(--accent-bright);
}

/* Small spaced-out label, as on the banner */
.overline {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--steel);
  margin: 0 0 14px;
}

/* =========================================================
   ACCESSIBILITY & GLOBAL ELEMENTS
   ========================================================= */

.skip-link {
  position: absolute;
  top: -100px;
  left: 10px;
  background: var(--copper);
  color: #fff;
  font-weight: 700;
  padding: 8px 12px;
  z-index: 100;
  text-decoration: none;
}

.skip-link:focus {
  top: 10px;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent-bright);
  outline-offset: 2px;
}

/* =========================================================
   HEADER & NAVIGATION (dark frame)
   ========================================================= */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem var(--space-m);
  padding: 0.9rem var(--container-pad);
  background: rgba(20, 36, 46, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(159, 180, 187, 0.14);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: #f2f5f5;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: 0.01em;
}

.brand:hover {
  text-decoration: none;
  color: #fff;
}

.brand img {
  width: 34px;
  height: 34px;
  display: block;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem var(--space-m);
}

.site-nav a {
  font-weight: 500;
  font-size: 0.95rem;
  color: #b9c8cc;
  letter-spacing: 0.02em;
  padding: 0.3rem 0;
  border-bottom: 2px solid transparent;
}

.site-nav a:hover {
  color: #f2f5f5;
  text-decoration: none;
}

.site-nav a[aria-current="page"] {
  color: #f2f5f5;
  border-bottom-color: #d0845a;
}

/* =========================================================
   LAYOUT SECTIONS
   ========================================================= */

.content-section {
  padding: 80px var(--container-pad);
  border-bottom: 1px solid var(--line);
}

.content-section > h1 {
  margin-top: 0;
  font-size: 3rem;
  letter-spacing: -1px;
}

.section-header {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 40px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}

.section-header::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 46px;
  height: 2px;
  background: var(--accent-bright);
}

.section-header h2 {
  margin: 0;
  font-size: 2.1rem;
  letter-spacing: -0.5px;
}

#impact {
  background: var(--bg-raised);
}

/* =========================================================
   DARK HEROES (home hero + first section on each subpage)
   Wave mesh from the banner fades in from the right.
   ========================================================= */

.hero,
.page-hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(ellipse 60% 90% at 20% 40%, #1d3440, transparent 70%),
    linear-gradient(180deg, var(--navy), var(--navy-deep));
  border-bottom: none;
}

.hero::before,
.page-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: url("../img/wave.svg") no-repeat right -80px center / auto 120%;
  opacity: 0.5;
  -webkit-mask-image: linear-gradient(90deg, transparent 5%, rgba(0, 0, 0, 0.35) 40%, #000 80%);
  mask-image: linear-gradient(90deg, transparent 5%, rgba(0, 0, 0, 0.35) 40%, #000 80%);
}

.hero > *,
.page-hero > * {
  position: relative;
}

.hero {
  padding: 110px var(--container-pad) 70px;
}

.page-hero {
  padding: 90px var(--container-pad) 80px;
}

.hero__identity {
  max-width: 1200px;
  margin: 0 auto 60px;
}

.hero h1 {
  margin: 0;
  font-size: 3.3rem;
  line-height: 1.1;
  letter-spacing: -1px;
}

.hero__slogan {
  margin: 18px 0 0;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1.9rem;
  line-height: 1.2;
  color: var(--text-strong);
}

.hero__tagline {
  font-size: 1.05rem;
  color: var(--text);
  margin-top: 16px;
}

.hero__tagline .sep {
  color: var(--muted);
  margin: 0 0.5rem;
}

.hero__layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 48px;
  align-items: center;
}

.hero__content {
  max-width: 880px;
}

.hero__mark {
  width: 260px;
  height: 260px;
  display: block;
}

.hero__summary {
  font-size: 1.1rem;
  line-height: 1.75;
  color: var(--text);
  margin: 30px 0 0;
  max-width: 900px;
}

/* Short copper rule, as under the banner subline */
.hero__summary::before {
  content: "";
  display: block;
  width: 46px;
  height: 2px;
  background: var(--accent-bright);
  margin-bottom: 22px;
}

.hero__image {
  margin-top: 6px;
  display: flex;
  justify-content: flex-start;
}

.hero__image img {
  width: 240px;
  max-width: 240px;
  border-radius: var(--radius-m);
  box-shadow: var(--shadow);
  object-fit: cover;
}

@media (max-width: 900px) {
  .hero__layout {
    grid-template-columns: 1fr;
  }

  .hero__mark {
    display: none;
  }
}

@media (max-width: 600px) {
  .hero {
    padding-top: 64px;
  }

  .page-hero {
    padding: 64px var(--container-pad) 56px;
  }

  .hero h1,
  .content-section > h1 {
    font-size: 2.3rem;
    letter-spacing: -0.5px;
  }

  .hero__slogan {
    font-size: 1.4rem;
  }

  .section-header h2 {
    font-size: 1.6rem;
  }

  .content-section {
    padding: 56px var(--container-pad);
  }

  .site-header {
    padding: 0.8rem 5%;
  }

  .site-nav {
    gap: 0.4rem 1.1rem;
  }
}

/* =========================================================
   BUTTONS
   ========================================================= */

.button {
  display: inline-block;
  padding: 12px 26px;
  border-radius: 6px;
  background: var(--button-bg);
  color: var(--button-ink);
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: background 0.2s, box-shadow 0.2s, transform 0.2s;
}

.button:hover {
  background: var(--button-bg-hover);
  color: var(--button-ink);
  text-decoration: none;
  box-shadow: 0 10px 24px rgba(197, 111, 69, 0.25);
  transform: translateY(-2px);
}

/* =========================================================
   CARDS & NAVIGATION GRID
   ========================================================= */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 22px;
}

.card {
  border: 1px solid var(--border);
  padding: 25px;
  border-radius: var(--radius-m);
  background: var(--bg-soft);
  cursor: pointer;
  transition: 0.25s;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.card:hover {
  border-color: var(--accent-bright);
  box-shadow: var(--shadow);
  transform: translateY(-4px);
}

.card h3 {
  margin-top: 0;
  color: var(--steel);
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

.card p {
  color: var(--text);
}

.nav-btn {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  margin-top: 15px;
}

/* Research overview numbers */
#research-stats strong {
  display: block;
  font-family: var(--font-head);
  font-size: 2.4rem;
  line-height: 1;
  color: var(--text-strong);
}

/* =========================================================
   SERVICES
   ========================================================= */

.service-item {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  padding: 25px;
  border-radius: var(--radius-s);
  margin-bottom: 20px;
}

.service-item h4 {
  margin-top: 0;
  color: var(--text-strong);
  font-size: 1.15rem;
}

.service-item p {
  margin-bottom: 0;
  color: var(--text);
}

/* Key message on the LIDO-SuMa section: the copper "hotspot" block */
#lido-suma p + .service-item {
  border-color: rgba(197, 111, 69, 0.55);
  border-left: 3px solid var(--copper);
}

#lido-suma p + .service-item h4 {
  color: var(--accent);
}

/* =========================================================
   EDUCATION
   ========================================================= */

.edu-item {
  margin-bottom: 30px;
  padding-left: 20px;
  border-left: 2px solid var(--border);
}

.edu-year {
  font-weight: 600;
  color: var(--accent);
}

.edu-title {
  font-family: var(--font-head);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-strong);
}

/* =========================================================
   AWARDS
   ========================================================= */

.awards-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.award-card {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-top: 3px solid var(--copper);
  padding: 20px;
  border-radius: var(--radius-s);
}

.award-card strong {
  color: var(--text-strong);
}

.award-card p {
  margin-bottom: 0;
  color: var(--text);
}

/* =========================================================
   INDUSTRIAL DOMAINS
   ========================================================= */

.domain-list {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 15px;
}

.domain-list li {
  background: var(--bg-soft);
  padding: 15px 20px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--steel);
  border-radius: 6px;
  font-weight: 600;
  color: var(--text-strong);
}

/* =========================================================
   PUBLICATIONS
   ========================================================= */

.publication-list {
  padding-left: 0;
  list-style: none;
}

.publication {
  padding: var(--space-s) 0;
  border-bottom: 1px solid var(--border);
}

.publication__title {
  font-weight: 600;
  color: var(--text-strong);
}

.publication__authors {
  color: var(--muted);
}

.publication__meta {
  font-size: 0.9rem;
  color: var(--muted);
}

/* =========================================================
   CLOSING STRIP (one dark strip before the footer)
   ========================================================= */

.cta-strip {
  padding: 80px var(--container-pad);
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(ellipse 50% 90% at 85% 50%, #1d3440, transparent 70%),
    var(--navy);
}

.cta-strip h2 {
  margin: 0 0 12px;
  font-size: 2.2rem;
  letter-spacing: -0.5px;
}

.cta-strip p {
  max-width: 720px;
  margin: 0 0 28px;
}

/* =========================================================
   FOOTER (dark frame)
   ========================================================= */

.site-footer {
  padding: 44px var(--container-pad);
  background: var(--navy-deep);
  color: #8fa6ad;
  font-size: 0.9rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
}

.site-footer p {
  margin: 0;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.footer-brand img {
  width: 40px;
  height: 40px;
}

.footer-slogan {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1.05rem;
  color: #f2f5f5;
}

.footer-slogan .hl {
  color: #d0845a;
}

/* =========================================================
   STORY PAGE
   ========================================================= */

.story-hero__layout {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 48px;
  align-items: center;
}

.story-hero__image {
  margin: 0;
  position: relative;
}

/* The copper arc from the logo ring, around the portrait */
.story-hero__image::after {
  content: "";
  position: absolute;
  inset: -14px;
  border-radius: 50%;
  border: 1px solid rgba(159, 180, 187, 0.35);
  border-bottom-color: #d0845a;
  pointer-events: none;
}

.story-hero__image img {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.story-hero__lead {
  font-size: 1.15rem;
  color: var(--text);
  max-width: 700px;
}

.story-content {
  max-width: 900px;
  margin: 0 auto;
  font-size: 1.1rem;
  line-height: 1.8;
}

@media (max-width: 900px) {
  .story-hero__layout {
    grid-template-columns: 1fr;
  }

  .story-hero__image {
    max-width: 220px;
  }
}

/* =========================================================
   TIMELINE
   ========================================================= */

.timeline {
  max-width: 900px;
  margin: 0 auto;
}

.timeline h2 {
  margin-bottom: 50px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 30px;
  margin-bottom: 50px;
  position: relative;
}

.timeline-year {
  font-weight: 600;
  color: var(--accent);
  font-size: 1.05rem;
  padding-left: 20px;
}

.timeline-content h3 {
  margin: 0 0 10px;
  font-size: 1.2rem;
}

.timeline-content p {
  margin: 0 0 12px;
  line-height: 1.7;
  color: var(--text);
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border);
}

.timeline-item::after {
  content: "";
  position: absolute;
  left: -4px;
  top: 6px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--steel);
}

.timeline-item:last-child::after {
  background: var(--copper);
  border-color: var(--copper);
  box-shadow: 0 0 0 5px rgba(197, 111, 69, 0.2);
}

@media (max-width: 800px) {
  .timeline-item {
    grid-template-columns: 1fr;
  }

  .timeline-item::before,
  .timeline-item::after {
    display: none;
  }

  .timeline-year {
    margin-bottom: 6px;
    padding-left: 0;
  }
}

/* =========================================================
   FLOATING BACK-TO-TOP (GLOBAL)
   ========================================================= */

.back-to-top {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;

  width: auto;
  min-width: 3.4rem;
  height: 3.2rem;
  padding: 0 1rem;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;

  border: none;
  border-radius: 999px;

  background: var(--navy);
  color: #f2f5f5;
  box-shadow: 0 10px 24px rgba(20, 36, 46, 0.3);

  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1;

  cursor: pointer;

  opacity: 0;
  visibility: hidden;
  pointer-events: none;

  transform: translateY(8px);
  transition: opacity 160ms ease, transform 160ms ease;

  z-index: 9999;
}

.back-to-top::before {
  content: "↑";
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1;
  color: #d0845a;
}

.back-to-top.is-visible {
  opacity: 0.98;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.back-to-top:hover {
  background: #1d3440;
}

/* =========================================================
   PRINT: dark text on white paper
   ========================================================= */

@media print {
  .back-to-top,
  .hero__mark,
  .cta-strip {
    display: none !important;
  }

  html,
  body,
  .hero,
  .page-hero,
  .content-section,
  .card,
  .service-item,
  .award-card,
  .domain-list li,
  .site-footer,
  #impact {
    background: #fff !important;
    color: #1a1a1a !important;
    box-shadow: none !important;
  }

  .hero::before,
  .page-hero::before,
  .section-header::after,
  .timeline-item::after {
    display: none;
  }

  h1,
  h2,
  h3,
  h4,
  strong,
  p,
  .hero__summary,
  .hero__slogan,
  .edu-title,
  .publication__title,
  .timeline-content p {
    color: #1a1a1a !important;
  }

  a,
  .hl,
  .card h3,
  .edu-year,
  .timeline-year {
    color: #8c4526 !important;
  }

  .site-header {
    position: static;
    background: #fff !important;
  }

  .brand {
    color: #1a1a1a !important;
  }
}
