/* ThermoIris — Swiss grid and type, frosted-glass surfaces.
   12-column grid, flush-left type, one accent colour, glass cards over soft glows. */

:root {
  --font-display: 'Inter Tight', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --font-sans: 'Inter', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;

  --paper: #ECEEF2;
  --ink: #111213;
  --ink-2: #565C66;
  --ink-3: #8A909A;
  --rule: rgba(16, 24, 40, 0.10);
  --rule-strong: rgba(16, 24, 40, 0.22);

  --red: #E4312B;
  --amber: #F29A2E;
  --blue: #3B82F6;

  --glow-red: rgba(228, 49, 43, 0.22);
  --glow-blue: rgba(59, 130, 246, 0.22);
  --glow-amber: rgba(242, 154, 46, 0.18);

  --glass: rgba(255, 255, 255, 0.55);
  --glass-strong: rgba(255, 255, 255, 0.78);
  --glass-border: rgba(255, 255, 255, 0.8);
  --glass-blur: blur(22px) saturate(170%);
  --glass-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  --shadow-glass: 0 10px 40px rgba(16, 24, 40, 0.08);
  --shadow-lift: 0 18px 50px rgba(16, 24, 40, 0.14);

  --night: #0C0D0E;
  --night-2: rgba(255, 255, 255, 0.04);
  --night-rule: rgba(255, 255, 255, 0.10);
  --night-text: #F0F2F5;
  --night-text-2: #9FA6B0;

  --mod-fill: #1E2A3A;
  --mod-cell: rgba(255, 255, 255, 0.10);

  --r-sm: 12px;
  --r-md: 18px;
  --r-lg: 28px;

  --gutter: clamp(16px, 4vw, 48px);
  --gap: clamp(16px, 2vw, 28px);
  --max: 1360px;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #090B0F;
    --ink: #ECEEF2;
    --ink-2: #A4AAB5;
    --ink-3: #6E7581;
    --rule: rgba(255, 255, 255, 0.08);
    --rule-strong: rgba(255, 255, 255, 0.2);
    --red: #F04A43;

    --glow-red: rgba(240, 74, 67, 0.20);
    --glow-blue: rgba(59, 130, 246, 0.20);
    --glow-amber: rgba(242, 154, 46, 0.10);

    --glass: rgba(26, 30, 38, 0.5);
    --glass-strong: rgba(22, 25, 32, 0.82);
    --glass-border: rgba(255, 255, 255, 0.09);
    --glass-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.07);
    --shadow-glass: 0 10px 40px rgba(0, 0, 0, 0.35);
    --shadow-lift: 0 18px 50px rgba(0, 0, 0, 0.5);

    --night: #05070A;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; scroll-padding-top: 96px; }

body {
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.55;
  background: var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }

/* Backdrop: drifting colour glows under a faint Swiss grid */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.backdrop::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--rule) 1px, transparent 1px),
    linear-gradient(90deg, var(--rule) 1px, transparent 1px);
  background-size: 96px 96px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 20%, transparent 75%);
  opacity: 0.6;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  animation: drift 26s ease-in-out infinite alternate;
}

.orb-red   { width: 52vw; height: 52vw; left: -14vw; top: -18vw; background: var(--glow-red); }
.orb-blue  { width: 46vw; height: 46vw; right: -12vw; top: 8vh; background: var(--glow-blue); animation-delay: -8s; }
.orb-amber { width: 40vw; height: 40vw; left: 30vw; bottom: -20vw; background: var(--glow-amber); animation-delay: -16s; }

@keyframes drift {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(4vw, 3vh) scale(1.08); }
  100% { transform: translate(-3vw, 6vh) scale(0.96); }
}

/* Glass surface */
.glass,
.figure-cell,
.step,
.deliv {
  background: var(--glass);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-glass), var(--glass-highlight);
}

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gap);
}

.col-meta   { grid-column: 1 / span 3; }
.col-title  { grid-column: 4 / span 9; }
.col-body   { grid-column: 4 / span 9; }
.col-intro  { grid-column: 1 / span 5; }
.col-figure { grid-column: 6 / span 7; }

/* Type */
.label {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
  line-height: 1.5;
}

.label-red { color: var(--red); }

.lead {
  font-size: clamp(18px, 1.6vw, 22px);
  line-height: 1.45;
  color: var(--ink);
  max-width: 34em;
}

.h2 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(34px, 5vw, 68px);
  line-height: 0.98;
  letter-spacing: -0.035em;
  max-width: 14em;
  margin-bottom: clamp(28px, 4vw, 56px);
}

.hot-text {
  background: linear-gradient(95deg, var(--red) 10%, var(--amber) 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Header: floating glass bar */
.site-header {
  position: sticky;
  top: 12px;
  z-index: 10;
  padding: 0 var(--gutter);
}

.header-row {
  max-width: calc(var(--max) - 2 * var(--gutter));
  height: 60px;
  margin: 0 auto;
  padding: 0 10px 0 22px;
  display: flex;
  align-items: center;
  gap: 24px;
  background: var(--glass);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  box-shadow: var(--shadow-glass), var(--glass-highlight);
}

.wordmark {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 21px;
  letter-spacing: -0.045em;
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
}

.wordmark .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 10px var(--red);
  display: inline-block;
}

.wordmark-small { font-size: 17px; }

.nav {
  display: flex;
  gap: 2px;
  margin-left: auto;
  padding: 4px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ink) 4%, transparent);
  border: 1px solid var(--rule);
  font-size: 14px;
  font-weight: 500;
}

.nav a {
  display: inline-flex;
  gap: 7px;
  align-items: baseline;
  padding: 7px 14px;
  border-radius: 999px;
  color: var(--ink-2);
  transition: color 0.15s ease, background-color 0.15s ease;
}

.nav a:hover { color: var(--ink); background: var(--glass-strong); }

.nav .num {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--red);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-weight: 600;
  font-size: 15px;
  box-shadow: 0 8px 24px rgba(16, 24, 40, 0.18);
  transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.btn::after { content: '→'; font-family: var(--font-mono); }

.btn:hover {
  background: var(--red);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 10px 30px rgba(228, 49, 43, 0.35);
}

.btn-small { padding: 10px 18px; font-size: 13px; box-shadow: none; }
.btn-small::after { content: none; }

.btn-glass {
  background: var(--glass);
  color: var(--ink);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-glass), var(--glass-highlight);
}

.btn-glass::after { content: '↓'; }
.btn-glass:hover { background: var(--glass-strong); color: var(--ink); box-shadow: var(--shadow-lift), var(--glass-highlight); }

/* Hero */
.hero { padding-top: clamp(56px, 9vw, 128px); }

.hero .col-meta { padding-top: 14px; }

.hero-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(54px, 10.4vw, 156px);
  line-height: 0.9;
  letter-spacing: -0.055em;
  padding-bottom: 0.04em;
}

.hero-lower {
  margin-top: clamp(40px, 6vw, 88px);
  padding-top: 28px;
  border-top: 1px solid var(--rule-strong);
  row-gap: 40px;
  align-items: start;
}

.hero-lower .lead { margin-bottom: 32px; }

.cta-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}

/* Array illustration */
.array-figure {
  min-width: 0;
  padding: 14px;
  border-radius: var(--r-lg);
}

.array-head {
  display: flex;
  justify-content: space-between;
  padding: 2px 6px 12px;
}

.array-frame {
  position: relative;
  background: var(--night);
  padding: clamp(12px, 2vw, 22px);
  border-radius: var(--r-md);
  overflow: hidden;
  container-type: inline-size;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

#array { display: block; width: 100%; height: auto; }

.mod { fill: var(--mod-fill); }
.mod-warm { fill: var(--amber); }
.mod-hot { fill: #E4312B; }
.cell { stroke: var(--mod-cell); stroke-width: 1; }
.mark { fill: none; stroke: #fff; stroke-width: 1.5; }
.tag-bg { fill: rgba(255, 255, 255, 0.92); }
.tag {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  fill: #111213;
}

.scan {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 2px;
  background: #E4312B;
  box-shadow: 0 0 22px 6px rgba(228, 49, 43, 0.55);
  animation: scan 5.5s cubic-bezier(0.6, 0, 0.4, 1) infinite alternate;
}

@keyframes scan {
  from { transform: translateX(0); }
  to { transform: translateX(calc(100cqw - 2px)); }
}

.array-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  padding: 12px 6px 2px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-2);
}

.array-legend span { display: inline-flex; align-items: center; gap: 7px; }
.array-legend .illus { margin-left: auto; color: var(--ink-3); }

.sw { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.sw-hot { background: #E4312B; }
.sw-warm { background: var(--amber); }
.sw-ok { background: var(--mod-fill); }

@media (prefers-reduced-motion: reduce) {
  .scan { display: none; }
  .orb { animation: none; }
  html { scroll-behavior: auto; }
}

/* Figures */
.figures { margin-top: clamp(64px, 9vw, 128px); }

.figures-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--gap);
}

.figure-cell {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 28px;
  padding: 26px 24px 24px;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.figure-cell:hover,
.step:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lift), var(--glass-highlight);
}

.fig-num {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(44px, 5.4vw, 80px);
  line-height: 0.9;
  letter-spacing: -0.05em;
}

.fig-num small {
  font-size: 0.38em;
  letter-spacing: -0.02em;
  margin-left: 4px;
  color: var(--ink-2);
}

/* Affiliations: greyscale logos, full colour on hover */
.affil { margin-top: var(--gap); }

.affil-strip {
  display: flex;
  align-items: center;
  gap: 24px clamp(24px, 4vw, 56px);
  padding: 20px clamp(20px, 3vw, 36px);
  border-radius: var(--r-lg);
}

.affil-label { flex-shrink: 0; }

.affil-logos {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px 40px;
}

.affil-logos a {
  display: block;
  filter: grayscale(1);
  opacity: 0.72;
  transition: filter 0.3s ease, opacity 0.3s ease;
}

.affil-logos a:hover,
.affil-logos a:focus-visible {
  filter: none;
  opacity: 1;
}

.affil-logos img { display: block; width: auto; }

.logo-uom  { height: 72px; }
.logo-entc { height: 44px; }
.logo-ee   { height: 30px; }
.logo-m3s  { height: 40px; }
.logo-smu  { height: 46px; }

@media (prefers-color-scheme: dark) {
  /* SMU only ships a navy-on-white version */
  .logo-smu { filter: brightness(0) invert(1); }
  /* lift the crest's dark rings off the dark glass */
  .logo-uom { filter: brightness(1.7) contrast(0.9); }
}

/* Sections */
.section { padding-top: clamp(72px, 11vw, 160px); }

.section-meta {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 8px;
}

.section-num {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 15px;
  color: var(--red);
  letter-spacing: -0.01em;
}

.section-num::after {
  content: '';
  display: block;
  width: 32px;
  height: 2px;
  border-radius: 2px;
  background: var(--red);
  box-shadow: 0 0 10px var(--red);
  margin-top: 10px;
}

.two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--gap);
  color: var(--ink-2);
  max-width: 900px;
}

/* Steps */
.steps {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--gap);
}

.step {
  padding: 24px;
  min-width: 0;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--red);
  background: rgba(228, 49, 43, 0.10);
  border: 1px solid rgba(228, 49, 43, 0.25);
}

.step h3 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(28px, 2.8vw, 40px);
  letter-spacing: -0.035em;
  line-height: 1;
  margin: 44px 0 14px;
}

.step p { color: var(--ink-2); font-size: 16px; }

/* Deliverables */
.deliv { padding: 6px 28px; border-radius: var(--r-lg); }

.deliv-row {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 5fr);
  gap: var(--gap);
  padding: 22px 0;
}

.deliv-row + .deliv-row { border-top: 1px solid var(--rule); }

.deliv dt {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(20px, 2vw, 26px);
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.deliv dd { color: var(--ink-2); }

/* Platform: dark glass panel with its own glows */
.dark-panel {
  position: relative;
  overflow: hidden;
  padding: clamp(32px, 5vw, 72px) clamp(20px, 4vw, 56px);
  border-radius: calc(var(--r-lg) + 4px);
  background:
    radial-gradient(600px 360px at 12% 0%, rgba(228, 49, 43, 0.28), transparent 65%),
    radial-gradient(640px 400px at 100% 100%, rgba(59, 130, 246, 0.24), transparent 65%),
    var(--night);
  color: var(--night-text);
  box-shadow: var(--shadow-lift), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.dark-panel .label { color: var(--night-text-2); }
.lead-dark { color: var(--night-text-2); }

.viewer {
  margin-top: clamp(40px, 6vw, 72px);
  border-radius: var(--r-md);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--night-rule);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

.viewer-bar {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 56px;
  padding: 0 18px;
  border-bottom: 1px solid var(--night-rule);
  background: rgba(18, 20, 24, 0.5);
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
}

.viewer-brand {
  font-family: var(--font-display);
  font-weight: 900;
  letter-spacing: -0.04em;
  font-size: 16px;
}

.viewer-tabs {
  display: flex;
  gap: 2px;
  margin: 0 auto;
  padding: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--night-rule);
}

.viewer-tabs span {
  padding: 6px 12px;
  border-radius: 999px;
  color: var(--night-text-2);
}

.viewer-tabs b {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 11px;
  margin-right: 6px;
  color: #6E7581;
}

.viewer-tabs .on {
  background: rgba(255, 255, 255, 0.11);
  color: var(--night-text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.viewer-tabs .on b { color: #F04A43; }

.viewer-status {
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  color: var(--night-text-2);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.viewer-status i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #3CCB7F;
  box-shadow: 0 0 8px #3CCB7F;
}

.viewer-body { padding: clamp(12px, 3vw, 32px); }

#flight { display: block; width: 100%; height: auto; }
#flight .g { stroke: rgba(255, 255, 255, 0.05); stroke-width: 1; }
#flight .path { fill: none; stroke: rgba(255, 255, 255, 0.55); stroke-width: 1.5; }
#flight .wp { fill: rgba(255, 255, 255, 0.85); }
#flight .wp-hot { fill: #F04A43; stroke: #fff; stroke-width: 1.5; filter: drop-shadow(0 0 6px rgba(240, 74, 67, 0.9)); }

/* Contact */
.contact { padding-bottom: clamp(56px, 8vw, 112px); }

.contact-card {
  position: relative;
  overflow: hidden;
  padding: clamp(32px, 5vw, 72px) clamp(20px, 4vw, 56px);
  border-radius: calc(var(--r-lg) + 4px);
}

.contact-card::before {
  content: '';
  position: absolute;
  width: 520px;
  height: 520px;
  right: -160px;
  bottom: -220px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--glow-red), transparent 70%);
  pointer-events: none;
}

.contact-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(48px, 8.5vw, 128px);
  line-height: 0.9;
  letter-spacing: -0.05em;
  margin-bottom: 32px;
}

.contact .lead { color: var(--ink-2); margin-bottom: 40px; }

.contact-mail {
  position: relative;
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(22px, 3.2vw, 44px);
  letter-spacing: -0.03em;
  border-bottom: 3px solid var(--red);
  padding-bottom: 4px;
  overflow-wrap: anywhere;
  transition: color 0.15s ease;
}

.contact-mail:hover { color: var(--red); }

/* Footer */
.footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 24px;
  padding-top: 24px;
  padding-bottom: 32px;
  border-top: 1px solid var(--rule-strong);
}

/* Responsive */
@media (max-width: 1000px) {
  .col-meta, .col-title, .col-body, .col-intro, .col-figure { grid-column: 1 / -1; }
  .hero .col-meta { padding-top: 0; margin-bottom: 20px; }
  .section-meta { flex-direction: row; align-items: baseline; gap: 16px; margin-bottom: 24px; padding-top: 0; }
  .section-num::after { display: none; }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .figures-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .viewer-tabs span:not(.on) { display: none; }
}

@media (max-width: 720px) {
  .site-header { top: 8px; padding: 0 10px; }
  .header-row { padding: 0 8px 0 18px; height: 54px; }
  .nav { display: none; }
  .btn-small { margin-left: auto; }
  .two-col { grid-template-columns: 1fr; gap: 16px; }
  .steps { grid-template-columns: 1fr; }
  .step h3 { margin-top: 24px; }
  .deliv { padding: 4px 20px; }
  .deliv-row { grid-template-columns: 1fr; gap: 6px; }
  .viewer-status { display: none; }
  .affil-strip { flex-direction: column; align-items: flex-start; }
  .affil-logos { justify-content: flex-start; gap: 20px 28px; }
  .logo-uom  { height: 56px; }
  .logo-entc { height: 36px; }
  .logo-ee   { height: 26px; }
  .logo-m3s  { height: 32px; }
  .logo-smu  { height: 38px; }
  .array-figure { padding: 10px; }
  .array-legend .illus { margin-left: 0; }
  .orb { filter: blur(60px); }
}

@media (max-width: 480px) {
  .figures-row { grid-template-columns: 1fr; }
}
