/* ==========================================================================
   EIA — Apple-minimal design system (v4)
   Light, neutral, one blue accent. Generous white space. WCAG AA.
   ========================================================================== */

:root {
	--eia-bg:        #FFFFFF;
	--eia-bg-soft:   #F5F5F7;   /* light grey */
	--eia-ink:       #1D1D1F;   /* near-black */
	--eia-grey:      #6E6E73;   /* secondary text */
	--eia-line:      #D2D2D7;   /* hairline */
	--eia-green:     #7ED321;   /* EIA vibrant green */
	--eia-green-ink: #2E7D00;   /* accessible green text on white */
	--eia-blue:      #4FC3F7;   /* frozen blue */
	--eia-blue-ink:  #0277BD;   /* accessible frozen-blue text on white */
	--eia-accent:    var(--eia-green-ink); /* primary action color (AA on white) */
	--eia-accent-ink:#FFFFFF;
	--eia-font:      -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", "Inter", "Segoe UI", Arial, sans-serif;
	--eia-radius:    18px;
	--eia-maxw:      1200px;
}

* { box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
body { margin: 0; font-family: var(--eia-font); background: var(--eia-bg); color: var(--eia-ink); line-height: 1.5; }
img { max-width: 100%; display: block; }
a { color: var(--eia-accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- top bar (frosted, minimal) ---------- */
.topbar {
	position: sticky; top: 0; z-index: 50;
	display: flex; align-items: center; gap: 1.5rem;
	padding: 1.1rem clamp(1.5rem, 4vw, 3rem);
	background: rgba(255,255,255,.72);
	backdrop-filter: saturate(180%) blur(20px);
	-webkit-backdrop-filter: saturate(180%) blur(20px);
	border-bottom: 1px solid var(--eia-line);
}
.topbar .logo { display: flex; align-items: center; gap: 1.1rem; font-weight: 600; color: var(--eia-ink); font-size: 1.05rem; letter-spacing: -0.01em; text-decoration: none; }
.topbar .logo img {
	height: 52px; width: 52px; border-radius: 12px; display: block;
	box-shadow: 0 2px 8px rgba(0,0,0,.08);
	transition: transform .2s ease;
}
.topbar .logo:hover img { transform: scale(1.03); }
.topbar .logo .eu-stars { gap: .3rem; margin-left: .2rem; }
.topbar .logo .eu-stars svg { width: 16px; height: 16px; }
.topbar nav { display: flex; gap: 1.4rem; flex-wrap: wrap; align-items: center; flex: 1 1 auto; justify-content: center; }
.topbar nav a { color: var(--eia-ink); font-size: .92rem; opacity: .85; }
.topbar nav a:hover { opacity: 1; text-decoration: none; }
.topbar nav a[aria-current="page"] { color: var(--eia-accent); opacity: 1; }

/* one-time shine sweep on nav items when the site loads */
@keyframes eia-nav-shine {
  0%   { opacity: .55; color: var(--eia-ink); text-shadow: none; }
  45%  { opacity: .95; color: #6FBF2A; text-shadow: 0 0 6px rgba(126,211,33,.22), 0 0 1px rgba(126,211,33,.15); }
  100% { opacity: .85; color: var(--eia-ink); text-shadow: none; }
}
@media (prefers-reduced-motion: no-preference) {
  .topbar nav a { animation: eia-nav-shine 2.4s cubic-bezier(.33,.6,.35,1) both; }
  .topbar nav a:nth-child(1) { animation-delay: .30s; }
  .topbar nav a:nth-child(2) { animation-delay: .55s; }
  .topbar nav a:nth-child(3) { animation-delay: .80s; }
  .topbar nav a:nth-child(4) { animation-delay: 1.05s; }
  .topbar nav a:nth-child(5) { animation-delay: 1.30s; }
  .topbar nav a:nth-child(6) { animation-delay: 1.55s; }
  .topbar nav a:nth-child(7) { animation-delay: 1.80s; }
  .topbar nav a[aria-current="page"] { animation-name: eia-nav-shine; }
}
.topbar .apply {
	background: var(--eia-green); color: #1D1D1F !important;
	border-radius: 980px; padding: .4rem 1.1rem; font-weight: 600; opacity: 1;
}
.topbar .apply:hover { filter: brightness(1.05); }

/* ---------- hero ---------- */
.hero { text-align: center; padding: clamp(4rem, 10vw, 8rem) clamp(1rem, 5vw, 2rem) clamp(2rem, 5vw, 3rem); }
.hero .eyebrow {
	font-size: .85rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
	color: var(--eia-accent); margin: 0 0 1rem;
}
.hero h1 {
	font-size: clamp(2.4rem, 6vw, 4.5rem); line-height: 1.05; letter-spacing: -0.02em;
	font-weight: 700; margin: 0 auto 1.2rem; max-width: 16ch;
}
.hero p.lede { font-size: clamp(1.05rem, 2vw, 1.35rem); color: var(--eia-grey); max-width: 640px; margin: 0 auto 2rem; }
.hero .hero-img { max-width: var(--eia-maxw); margin: 2.5rem auto 0; border-radius: var(--eia-radius); overflow: hidden; }
.hero .hero-img img { width: 100%; height: auto; }

/* ---------- buttons ---------- */
.btn {
	display: inline-block; background: var(--eia-green); color: #1D1D1F !important;
	border-radius: 980px; padding: .8rem 1.6rem; font-weight: 600; font-size: 1.02rem; border: none;
}
.btn:hover { filter: brightness(1.05); text-decoration: none; }
.btn--ghost { background: transparent; color: var(--eia-blue-ink) !important; padding: .8rem .4rem; }
.btn--ghost:hover { text-decoration: underline; filter: none; }

/* ---------- generic section ---------- */
.section { max-width: var(--eia-maxw); margin: 0 auto; padding: clamp(3rem, 7vw, 5.5rem) clamp(1rem, 4vw, 2rem); }
.section--soft { background: var(--eia-bg-soft); max-width: none; }
.section--soft > .inner { max-width: var(--eia-maxw); margin: 0 auto; }
.section h2 { font-size: clamp(1.8rem, 4vw, 2.8rem); letter-spacing: -0.02em; font-weight: 700; margin: 0 0 .6rem; }
.section .sub { color: var(--eia-grey); font-size: 1.1rem; max-width: 640px; margin: 0 0 2.5rem; }
.center { text-align: center; }
.center .sub { margin-left: auto; margin-right: auto; }

/* ---------- pillar / feature cards ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.5rem; }
.card {
	background: var(--eia-bg); border-radius: var(--eia-radius); overflow: hidden;
	border: 1px solid var(--eia-line); transition: transform .25s ease, box-shadow .25s ease;
	display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 12px 32px rgba(0,0,0,.08); }
.card img { width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.card .card-body { padding: 1.4rem 1.4rem 1.6rem; display: flex; flex-direction: column; flex: 1; }
.card h3 { margin: 0 0 .5rem; font-size: 1.25rem; letter-spacing: -0.01em; }
.card p { margin: 0 0 1rem; color: var(--eia-grey); font-size: .98rem; }
.card .meta { font-size: .8rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--eia-accent); margin-bottom: .5rem; }
.card a.card-link { font-weight: 500; margin-top: auto; }

/* ---------- stats ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 2rem; text-align: center; }
/* home one-pager: always one horizontal row, never wrap */
.fit-stats .stats { display: flex; flex-wrap: nowrap; justify-content: space-between; align-items: baseline; gap: clamp(.6rem, 2vw, 2rem); }
.fit-stats .stats > div { flex: 1 1 0; min-width: 0; }
.stats .num { display: block; font-size: clamp(2.2rem, 5vw, 3.4rem); font-weight: 700; letter-spacing: -0.02em; color: var(--eia-ink); }
.stats .lbl { color: var(--eia-grey); font-size: .95rem; }

/* ---------- tickers (minimal, light) ---------- */
.eia-ticker, .eia-index {
	background: var(--eia-bg-soft); border-top: 1px solid var(--eia-line); border-bottom: 1px solid var(--eia-line);
	font-size: .85rem; color: var(--eia-ink);
}
.eia-ticker { display: flex; align-items: center; gap: .9rem; padding: .7rem 1.2rem; }
.eia-ticker__label { color: var(--eia-accent); font-weight: 700; letter-spacing: .12em; white-space: nowrap; font-size: .75rem; }
.eia-ticker__trackwrap { overflow: hidden; flex: 1; }
.eia-ticker__track { display: inline-flex; gap: 2.5rem; white-space: nowrap; animation: eia-scroll 45s linear infinite; }
.eia-ticker:hover .eia-ticker__track, .eia-ticker:focus-within .eia-ticker__track { animation-play-state: paused; }
.eia-ticker__item { color: var(--eia-ink); }
.eia-ticker__item time { color: var(--eia-grey); margin-left: .5rem; font-size: .78rem; }
.eia-ticker__tag { color: #1A3A00; background: var(--eia-green); border-radius: 980px; padding: .12rem .6rem; margin-right: .5rem; font-size: .68rem; font-weight: 700; letter-spacing: .02em; box-shadow: 0 1px 3px rgba(126,211,33,.35); }
.eia-ticker__all { color: var(--eia-accent); white-space: nowrap; }

.eia-index { display: flex; align-items: center; gap: .9rem; overflow: hidden; padding: .75rem 1.2rem; background: #fff; }
.eia-index__label { color: var(--eia-accent); font-weight: 700; letter-spacing: .12em; white-space: nowrap; font-size: .75rem; flex: 0 0 auto; }
.eia-index__trackwrap { overflow: hidden; flex: 1; }
.eia-index__track { display: inline-flex; gap: 3rem; white-space: nowrap; animation: eia-scroll 60s linear infinite; padding-left: 1rem; }
.eia-index:hover .eia-index__track, .eia-index:focus-within .eia-index__track { animation-play-state: paused; }
.eia-index__item { color: var(--eia-ink); display: inline-flex; gap: .55rem; align-items: baseline; }
.eia-index__item strong { color: var(--eia-ink); font-weight: 600; }
.eia-index__mom { color: var(--eia-accent); }
.eia-index__sec, .eia-index__sdg { color: var(--eia-grey); font-size: .75rem; }
@keyframes eia-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .eia-ticker__track, .eia-index__track { animation: none; } }

/* ---------- constellation (light) ---------- */
.eia-constellation {
	position: relative; width: 100%; min-height: 440px;
	background: var(--eia-bg-soft); border-radius: var(--eia-radius); overflow: hidden;
	border: 1px solid var(--eia-line);
}
.eia-constellation canvas { display: block; width: 100%; height: 100%; }
.eia-constellation__card {
	position: absolute; pointer-events: none; max-width: 260px;
	background: rgba(255,255,255,.95); border: 1px solid var(--eia-line);
	border-radius: 12px; padding: .7rem .9rem; color: var(--eia-ink);
	font-size: .85rem; display: none; box-shadow: 0 8px 24px rgba(0,0,0,.1);
}
.eia-constellation__card strong { color: var(--eia-accent); }

/* ---------- lists (publications / experiments) ---------- */
.eia-pubs { line-height: 1.8; padding-left: 1.2rem; }
.eia-pubs__title { color: var(--eia-ink); font-weight: 500; }
.eia-pubs__venue { color: var(--eia-grey); }
.eia-log { list-style: none; padding: 0; }
.eia-log__item { border-left: 2px solid var(--eia-line); padding: .4rem 0 .4rem 1rem; margin-bottom: 1rem; }
.eia-log__status { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; background: var(--eia-bg-soft); border: 1px solid var(--eia-line); color: var(--eia-grey); border-radius: 980px; padding: .1rem .55rem; margin-right: .5rem; }
.eia-log__status--completed { color: var(--eia-accent); border-color: var(--eia-accent); }
.eia-log time { color: var(--eia-grey); font-size: .8rem; margin-left: .5rem; }

/* ---------- footer ---------- */
footer { border-top: 1px solid var(--eia-line); color: var(--eia-grey); padding: 1.8rem clamp(1rem,5vw,2.5rem); font-size: .85rem; text-align: center; }

@media (max-width: 720px) {
	.topbar { gap: .8rem; }
	.topbar nav { gap: .9rem; font-size: .85rem; }
}

/* ---------- European stars (frozen blue) ---------- */
.eu-stars { display: inline-flex; gap: .35rem; justify-content: center; align-items: center; color: var(--eia-blue); }
.eu-stars svg { width: 18px; height: 18px; }
.eu-stars--lg svg { width: 26px; height: 26px; }
.eu-stars__label { color: var(--eia-grey); font-size: .85rem; letter-spacing: .14em; text-transform: uppercase; margin-left: .5rem; }

/* ---------- wireframe story cards (Research / Education / Innovation) ---------- */
.stories { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.75rem; }
.story {
	background: var(--eia-bg); border: 1px solid var(--eia-line); border-radius: var(--eia-radius);
	overflow: hidden; display: flex; flex-direction: column; text-decoration: none; color: var(--eia-ink);
	transition: transform .25s ease, box-shadow .25s ease;
}
.story:hover { transform: translateY(-4px); box-shadow: 0 14px 36px rgba(0,0,0,.09); text-decoration: none; }
.story .story-head { padding: 1.5rem 1.5rem 1.1rem; }
.story .story-head .kicker { font-size: .8rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; margin: 0 0 .5rem; }
.story .story-head .kicker--research { color: var(--eia-blue-ink); }
.story .story-head .kicker--education { color: var(--eia-green-ink); }
.story .story-head .kicker--innovation { color: var(--eia-blue-ink); }
.story .story-head h3 { margin: 0; font-size: 1.5rem; letter-spacing: -0.01em; line-height: 1.2; }
.story .story-img { overflow: hidden; }
.story .story-img img, .story .story-img video { width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block; transition: transform .4s ease; }
.story:hover .story-img img, .story:hover .story-img video { transform: scale(1.03); }
.story .story-foot { padding: 1.1rem 1.5rem 1.5rem; margin-top: auto; }
.story .story-foot .more { color: var(--eia-accent); font-weight: 600; }

/* ---------- hero two-row lock (desktop) with mobile wrap ---------- */
@media (max-width: 720px) {
	.hero-nowrap { white-space: normal !important; }
}

/* ---------- one-pager compact home ---------- */
.home-compact .story .story-head { padding: 1rem 1.2rem .7rem; }
.home-compact .story .story-head h3 { font-size: 1.15rem; }
.home-compact .story .story-img img { aspect-ratio: 16/9; }
.home-compact .story .story-foot { padding: .7rem 1.2rem 1rem; }
.home-compact .stats .num { font-size: clamp(1.8rem, 3.4vw, 2.6rem); }
.home-compact .section { padding-top: .8rem; padding-bottom: .8rem; }

/* ---------- one-screen fit layout (home) ---------- */
body.home-compact { overflow: hidden; display: flex; flex-direction: column; height: 100vh; height: 100svh; }
body.home-compact .topbar { position: static; flex: 0 0 auto; }
main.fit {
	display: flex; flex-direction: column;
	flex: 1 1 auto; min-height: 0;            /* fill the viewport left after the top bar */
	width: 100%; max-width: 1400px; margin: 0 auto;
	padding: 0 clamp(1rem, 4vw, 3rem);
}
main.fit > * { flex: 0 0 auto; }

/* hero: compact, scales down on short screens */
.fit-hero { padding-top: clamp(.6rem, 2.2vh, 2rem); padding-bottom: clamp(.4rem, 1.4vh, 1rem); }
.fit-hero h1 { font-size: clamp(1.4rem, 3.4vh, 2.4rem); letter-spacing: -0.02em; margin: 0 auto .4rem; white-space: nowrap; }
.fit-hero .sub { margin: 0 auto; white-space: nowrap; font-size: clamp(.85rem, 1.8vh, 1rem); color: var(--eia-grey); }

/* stories: this is the flexible region that absorbs leftover space */
.fit-stories { flex: 1 1 auto; min-height: 0; display: flex; align-items: center; padding: clamp(1.4rem, 4vh, 3rem) 0 clamp(.6rem, 2vh, 1.4rem); }
.fit-stories .stories { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(.8rem, 1.6vw, 1.5rem); width: 100%; min-height: 0; }
.fit-stories .story { display: flex; flex-direction: column; min-height: 0; }
.fit-stories .story .story-head { padding: clamp(.6rem,1.4vh,1rem) clamp(.8rem,1.4vw,1.2rem) clamp(.3rem,.8vh,.6rem); }
.fit-stories .story .story-head h3 { font-size: clamp(.95rem, 2vh, 1.2rem); line-height: 1.18; }
.fit-stories .story .story-head .kicker { font-size: clamp(.62rem,1.3vh,.72rem); margin-bottom: .3rem; }
.fit-stories .story .story-img { flex: 1 1 auto; min-height: 0; max-height: 42vh; }
.fit-stories .story .story-img video { width: 100%; height: 100%; aspect-ratio: auto; object-fit: cover; }
.fit-stories .story .story-foot { padding: clamp(.5rem,1.2vh,.8rem) clamp(.8rem,1.4vw,1.2rem) clamp(.7rem,1.6vh,1rem); }
.fit-stories .story .story-foot .more { font-size: clamp(.8rem,1.6vh,.95rem); }

/* stats: compact band */
.fit-stats { padding: clamp(.5rem, 1.8vh, 1.4rem) 0; }
.fit-stats .stats .num { font-size: clamp(1.5rem, 4.2vh, 2.6rem); }
.fit-stats .stats .lbl { font-size: clamp(.7rem, 1.5vh, .85rem); }

/* tickers pinned at the bottom of the viewport */
/* tickers stay inside the padded container so their labels/pills remain fully visible */
main.fit .eia-index, main.fit .eia-ticker { margin-left: 0; margin-right: 0; border-radius: 12px; }

/* footer sits below the 100vh main (off-screen); hide on the one-pager */
body.home-compact footer { display: none; }

/* stack to a scrollable layout on narrow screens (mobile) */
@media (max-width: 860px) {
	body.home-compact { overflow: auto; }
	main.fit { height: auto; }
	.fit-stories .stories { grid-template-columns: 1fr; }
	.fit-stories .story .story-img video { aspect-ratio: 16/9; height: auto; }
	body.home-compact footer { display: block; }
}

/* ---------- centered title/subtitle header ---------- */
.topbar--center {
	flex-direction: column; align-items: center; justify-content: center;
	gap: .5rem; padding: clamp(.7rem, 2vh, 1.2rem) clamp(1.5rem, 4vw, 3rem) clamp(.6rem, 1.6vh, 1rem);
	text-align: center;
}
.topbar--center .brand { display: flex; align-items: center; gap: .9rem; text-decoration: none; color: var(--eia-ink); }
.topbar--center .brand-logo { height: clamp(44px, 6.5vh, 56px); width: clamp(44px, 6.5vh, 56px); border-radius: 12px; display: block; box-shadow: 0 2px 8px rgba(0,0,0,.08); transition: transform .2s ease; }
.topbar--center .brand:hover .brand-logo { transform: scale(1.03); }
.topbar--center .brand-text { display: flex; flex-direction: column; align-items: flex-start; text-align: left; line-height: 1.15; }
.topbar--center .brand-title { display: flex; align-items: center; gap: .55rem; font-weight: 700; font-size: clamp(1.05rem, 2.4vh, 1.35rem); letter-spacing: -0.01em; }
.topbar--center .brand-title .eu-stars { gap: .22rem; margin-left: .1rem; }
.topbar--center .brand-title .eu-stars svg { width: clamp(13px, 1.8vh, 16px); height: clamp(13px, 1.8vh, 16px); }
.topbar--center .brand-sub { font-size: clamp(.72rem, 1.5vh, .85rem); color: var(--eia-grey); font-weight: 500; letter-spacing: .01em; }
.topbar--center nav { flex: 0 0 auto; justify-content: center; margin: 0; }


/* soft wave animation across the 5 EU stars (European ripple) */
@keyframes eia-star-wave {
  0%, 100% { transform: translateY(0) scale(1); opacity: .75; filter: drop-shadow(0 0 0 rgba(79,195,247,0)); }
  50%      { transform: translateY(-3px) scale(1.18); opacity: 1; filter: drop-shadow(0 0 5px rgba(79,195,247,.7)); }
}
@media (prefers-reduced-motion: no-preference) {
  .eu-stars svg { animation: eia-star-wave 2.6s ease-in-out infinite; }
  .eu-stars svg:nth-child(1) { animation-delay: 0s; }
  .eu-stars svg:nth-child(2) { animation-delay: .22s; }
  .eu-stars svg:nth-child(3) { animation-delay: .44s; }
  .eu-stars svg:nth-child(4) { animation-delay: .66s; }
  .eu-stars svg:nth-child(5) { animation-delay: .88s; }
}
