/* =============================================================
   Nikolaos Synodinos — portfolio
   Dark, editorial, optical. One display face + one sans.
   ============================================================= */

:root {
  /* Surfaces */
  --bg:        #08090b;   /* deep near-black */
  --bg-2:      #0d0f12;   /* raised panels */
  --line:      rgba(255,255,255,0.10);
  --line-soft: rgba(255,255,255,0.06);

  /* Ink */
  --ink:       #f2f3f5;   /* primary text */
  --ink-soft:  #b7bcc4;   /* secondary */
  --ink-faint: #6f7680;   /* tertiary / labels */

  /* Thread accents (also injected from config.js for JS use) */
  --dentistry: #56b6a6;
  --research:  #8e9be6;
  --personal:  #e0a15e;
  --accent:    var(--dentistry); /* per-section override */

  /* Type */
  --display: "Fraunces", Georgia, "Times New Roman", serif;
  --sans:    "Inter", system-ui, -apple-system, sans-serif;

  /* Rhythm */
  --maxw: 1180px;
  --gutter: clamp(1.25rem, 5vw, 4rem);
  --section-pad: clamp(5rem, 12vh, 11rem);

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 400;
  line-height: 1.6;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

::selection { background: rgba(142,155,230,0.32); color: #fff; }

/* Subtle vignette so the page feels lit from the centre (optical) */
body::after {
  content: "";
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(120% 90% at 50% 30%, transparent 55%, rgba(0,0,0,0.55) 100%);
}
#site { position: relative; z-index: 1; }

/* ---------- Accessibility helpers ---------- */
.skip-link {
  position: fixed; top: 12px; left: 12px; z-index: 9999;
  background: var(--ink); color: var(--bg);
  padding: 10px 16px; border-radius: 8px; font-weight: 600;
  transform: translateY(-150%); transition: transform .2s var(--ease);
}
.skip-link:focus { transform: translateY(0); }

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

/* ---------- Layout ---------- */
.section__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding-inline: var(--gutter);
  width: 100%;
}
.section { padding-block: var(--section-pad); }

.section__index, .thread__index {
  font-size: 0.8rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 1.4rem;
}

.section__title, .thread__title {
  font-family: var(--display);
  font-weight: 400;
  font-optical-sizing: auto;
  line-height: 1.04;
  letter-spacing: -0.015em;
  margin: 0 0 1.6rem;
}
.section__title { font-size: clamp(2rem, 5vw, 3.4rem); }

/* =============================================================
   APERTURE INTRO
   ============================================================= */
#intro-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: #050507;
}
#intro-overlay .iris { width: 100%; height: 100%; display: block; }
.iris-blades .blade line {
  stroke: rgba(255,255,255,0.06);
  stroke-width: 0.4;
}
#irisRing {
  stroke: rgba(255,255,255,0.9); stroke-width: 0.5;
  filter: drop-shadow(0 0 1.6px rgba(155,123,234,0.9));
}
#irisBloom { mix-blend-mode: screen; }

#intro-skip {
  position: absolute; bottom: 28px; right: 28px;
  background: transparent; color: rgba(255,255,255,0.6);
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: 999px; padding: 8px 20px;
  font-family: var(--sans); font-size: 0.78rem; letter-spacing: 0.12em;
  text-transform: uppercase; cursor: pointer;
  transition: color .2s, border-color .2s;
}
#intro-skip:hover { color: #fff; border-color: rgba(255,255,255,0.5); }

/* =============================================================
   HERO
   ============================================================= */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center;
  padding: 6rem var(--gutter) 4rem;
}
.hero__inner { max-width: 760px; width: 100%; }

.hero__eyebrow {
  font-size: 0.82rem; letter-spacing: 0.28em; text-transform: uppercase;
  color: var(--ink-faint); margin: 0 0 1.4rem;
  display: flex; gap: 0.7em; justify-content: center; flex-wrap: wrap;
}
.hero__eyebrow a {
  color: var(--ink-faint);
  transition: color .25s var(--ease);
  position: relative;
}
.hero__eyebrow a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -3px; height: 1px;
  background: currentColor; transform: scaleX(0); transform-origin: left;
  transition: transform .3s var(--ease);
}
.hero__eyebrow a:hover::after, .hero__eyebrow a:focus-visible::after { transform: scaleX(1); }
.hero__eyebrow a:nth-of-type(1):hover { color: var(--dentistry); }
.hero__eyebrow a:nth-of-type(2):hover { color: var(--research); }
.hero__eyebrow a:nth-of-type(3):hover { color: var(--personal); }
.hero__name {
  font-family: var(--display);
  font-weight: 300; font-optical-sizing: auto;
  font-size: clamp(2.8rem, 9vw, 6.2rem);
  line-height: 0.98; letter-spacing: -0.02em;
  margin: 0;
}
.hero__name-line { display: block; }
.hero__tagline {
  font-family: var(--display);
  font-style: italic; font-weight: 400;
  font-size: clamp(1.05rem, 2.4vw, 1.5rem);
  color: var(--ink-soft);
  margin: 1.4rem 0 0; min-height: 1.6em;
}

/* ---- Constellation ---- */
.constellation-wrap {
  margin-top: clamp(1.5rem, 4vh, 3rem);
  width: 100%;
}
#constellation {
  width: min(560px, 86vw);
  height: auto; margin: 0 auto;
  display: block; overflow: visible;
  cursor: default;
}
/* DSLR viewfinder furniture (Canon 400D inspired) */
.vf__frame  { fill: none; stroke: rgba(255,255,255,0.07); }
.vf__corner { fill: none; stroke: rgba(255,255,255,0.30); stroke-width: 1.4; stroke-linecap: round; }
.af-pt      { fill: none; stroke: rgba(255,255,255,0.13); stroke-width: 1; }  /* 9-point AF array */
.vf__spot   { fill: none; stroke: rgba(255,255,255,0.16); stroke-width: 1; } /* spot-metering circle */
.centre__core { fill: #fff; opacity: 0.85; filter: drop-shadow(0 0 4px rgba(255,255,255,0.55)); }
.reticle__tick { stroke: rgba(255,255,255,0.45); stroke-width: 1; }

/* The 3 active AF squares — float freely, snap-lock onto a subject on hover */
.afsq path { fill: none; stroke: rgba(255,255,255,0.32); stroke-width: 1.3; stroke-linecap: round; }
.afsq__b {
  transform-box: fill-box; transform-origin: center; transform: scale(1);
  transition: transform .3s var(--ease);
}
.afsq.is-locked .afsq__b { transform: scale(1.7); }
.afsq.is-locked path { stroke: var(--lock, #fff); stroke-width: 1.7; }

.node { cursor: pointer; }
.node__glow {
  fill: var(--node-accent, #fff);
  opacity: 0.16;
  filter: blur(6px);
  transition: opacity .35s var(--ease);
}
.node__core {
  fill: var(--node-accent, #fff);
  filter: drop-shadow(0 0 4px var(--node-accent, #fff));
  transition: r .3s var(--ease);
}
.node__label {
  fill: var(--ink-soft);
  font-family: var(--sans);
  font-size: 15px; font-weight: 500;
  letter-spacing: 0.06em;
  text-anchor: middle;
  transition: fill .3s var(--ease);
  pointer-events: none;
}
.node[data-thread="dentistry"] { --node-accent: var(--dentistry); }
.node[data-thread="research"]  { --node-accent: var(--research); }
.node[data-thread="personal"]  { --node-accent: var(--personal); }

.node:hover .node__glow,
.node.is-active .node__glow { opacity: 0.5; }
.node:hover .node__core,
.node.is-active .node__core { r: 9; }
.node:hover .node__label,
.node.is-active .node__label { fill: #fff; }

/* Depth of field: when one subject is in focus, the others blur out */
#constellation.has-active .node:not(.is-active) {
  opacity: 0.4; filter: blur(2.4px);
  transition: opacity .3s var(--ease), filter .3s var(--ease);
}

.constellation__caption {
  margin: 1.6rem 0 0;
  font-size: 0.92rem; color: var(--ink-faint);
  min-height: 1.4em;
  transition: color .3s var(--ease);
}

/* ---- Scroll cue ---- */
.scroll-cue {
  position: absolute; bottom: 2rem; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  color: var(--ink-faint);
}
.scroll-cue__text { font-size: 0.7rem; letter-spacing: 0.22em; text-transform: uppercase; }
.scroll-cue__line {
  width: 1px; height: 46px;
  background: linear-gradient(to bottom, var(--ink-faint), transparent);
  animation: cue 2.4s var(--ease) infinite;
  transform-origin: top;
}
@keyframes cue {
  0%   { transform: scaleY(0); opacity: 0; }
  40%  { transform: scaleY(1); opacity: 1; }
  100% { transform: scaleY(1) translateY(46px); opacity: 0; }
}

/* =============================================================
   ABOUT
   ============================================================= */
.about__lead {
  font-family: var(--display);
  font-weight: 300; font-optical-sizing: auto;
  font-size: clamp(1.3rem, 3vw, 2rem);
  line-height: 1.4; color: var(--ink);
  max-width: 22ch; margin: 0;
  max-width: 30ch;
}
.about__highlights {
  margin: 2.4rem 0 0;
  padding-top: 1.6rem;
  border-top: 1px solid var(--line-soft);
  font-size: 0.95rem; color: var(--ink-faint);
  letter-spacing: 0.02em;
}

/* =============================================================
   THREADS
   ============================================================= */
.thread { padding-block: var(--section-pad); position: relative; }
.thread[data-thread="dentistry"] { --accent: var(--dentistry); }
.thread[data-thread="research"]  { --accent: var(--research); }
.thread[data-thread="personal"]  { --accent: var(--personal); }

/* Accent rule that ties each block to its node colour */
.thread__index { color: var(--accent); position: relative; padding-left: 2.6rem; }
.thread__index::before {
  content: ""; position: absolute; left: 0; top: 0.45em;
  width: 2rem; height: 1px; background: var(--accent);
}
.thread__title {
  font-size: clamp(2.4rem, 7vw, 5rem);
  color: var(--ink);
}
.thread__title::after {
  content: ""; display: block; width: 56px; height: 3px;
  margin-top: 1.2rem; border-radius: 2px;
  background: var(--accent);
  box-shadow: 0 0 24px var(--accent);
}
.thread__body {
  max-width: 56ch; font-size: 1.08rem; color: var(--ink-soft);
  margin: 0;
}

/* Optical transition between frames: an aperture wipe (scrubbed to scroll) */
.frame-divider {
  display: flex; align-items: center; gap: 1.6rem;
  width: 100%; max-width: var(--maxw); margin: 0 auto;
  padding: clamp(2rem, 6vh, 4rem) var(--gutter);
}
.fd-line {
  height: 1px; flex: 1; transform: scaleX(0); transform-origin: center;
  background: linear-gradient(to right, transparent, var(--line) 50%, transparent);
}
.fd-iris { width: 26px; height: 26px; flex: none; color: var(--accent, var(--ink-faint)); opacity: 0.6; }
.fd-iris__inner { transform-box: fill-box; transform-origin: center; }

/* Two-column frame layout: lead copy + an editorial focus list */
.frame__grid {
  display: grid; grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(2rem, 6vw, 5rem); align-items: start; margin-top: 0.5rem;
}
@media (max-width: 760px) { .frame__grid { grid-template-columns: 1fr; gap: 2.2rem; } }

.field-list { margin: 0; }
.field {
  padding: 1.05rem 0; border-top: 1px solid var(--line-soft);
}
.field:first-child { border-top: none; padding-top: 0.2rem; }
.field__term {
  margin: 0 0 0.25rem;
  font-weight: 600; font-size: 0.74rem;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--accent);
}
.field__desc { margin: 0; color: var(--ink-soft); font-size: 1rem; line-height: 1.5; }

/* Case-presentations placeholder (before/after) */
.cases {
  margin-top: 3rem;
  border: 1px dashed var(--line);
  border-radius: 16px;
  padding: clamp(1.4rem, 4vw, 2.4rem);
  background: linear-gradient(180deg, rgba(255,255,255,0.015), transparent);
}
.cases__label {
  margin: 0 0 1.4rem; font-size: 0.8rem; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--ink-faint);
}
.cases__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.case { margin: 0; }
.case__frame {
  position: relative; aspect-ratio: 4 / 3;
  border-radius: 10px;
  background:
    repeating-linear-gradient(45deg, rgba(255,255,255,0.018) 0 12px, transparent 12px 24px),
    var(--bg-2);
  border: 1px solid var(--line-soft);
  display: flex; align-items: flex-end;
}
.case__tag {
  margin: 12px; font-size: 0.72rem; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--ink-faint);
  border: 1px solid var(--line); padding: 4px 10px; border-radius: 999px;
}
.case__caption { margin: 0.7rem 2px 0; font-size: 0.82rem; color: var(--ink-faint); }
.cases__soon { margin: 1.6rem 0 0; font-size: 0.85rem; color: var(--accent); }

/* Generic empty placeholder (e.g. publications / DOIs) */
.placeholder {
  margin-top: 3rem;
  border: 1px dashed var(--line); border-radius: 16px;
  padding: clamp(1.4rem, 4vw, 2.4rem);
  background: linear-gradient(180deg, rgba(255,255,255,0.015), transparent);
}
.placeholder__label {
  margin: 0 0 1.4rem; font-size: 0.8rem; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--ink-faint);
}
.pub-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.8rem; }
.pub {
  height: 54px; border-radius: 10px;
  background:
    repeating-linear-gradient(45deg, rgba(255,255,255,0.018) 0 12px, transparent 12px 24px),
    var(--bg-2);
  border: 1px solid var(--line-soft);
}
.placeholder__note { margin: 1.6rem 0 0; font-size: 0.85rem; color: var(--accent); }

/* =============================================================
   CONNECT
   ============================================================= */
.connect { --accent: var(--research); }
.connect__links {
  list-style: none; padding: 0; margin: 0;
  border-top: 1px solid var(--line-soft);
}
.connect__link {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.3rem 0.2rem;
  border-bottom: 1px solid var(--line-soft);
  font-family: var(--display); font-weight: 400;
  font-size: clamp(1.4rem, 4vw, 2.2rem);
  color: var(--ink); position: relative;
  transition: color .25s var(--ease), padding-left .3s var(--ease);
}
.connect__link::after {
  content: "↗"; font-family: var(--sans); font-size: 0.9rem;
  color: var(--ink-faint); transition: color .25s, transform .3s var(--ease);
}
#link-email::after { content: "→"; }
.connect__link:hover { color: var(--brand, var(--accent)); padding-left: 0.9rem; }
.connect__link:hover::after { color: var(--brand, var(--accent)); transform: translateX(4px); }

/* Each link hovers in its own brand colour */
#link-linkedin     { --brand: #2d8fe0; } /* LinkedIn blue (lightened for dark bg) */
#link-instagram    { --brand: #f592c0; } /* Instagram pink (light) */
#link-researchgate { --brand: #2bd4c4; } /* ResearchGate teal */
#link-email        { --brand: var(--personal); } /* amber — distinct from the violet CV button */

.cv-button {
  display: inline-flex; align-items: center; gap: 0.6rem;
  margin-top: 2.6rem;
  padding: 0.9rem 1.6rem;
  border: 1px solid var(--accent); border-radius: 999px;
  color: var(--ink); font-weight: 500; font-size: 0.95rem;
  transition: background .25s var(--ease), color .25s, box-shadow .3s;
}
.cv-button:hover {
  background: var(--accent); color: var(--bg);
  box-shadow: 0 0 36px color-mix(in srgb, var(--accent) 45%, transparent);
}

/* =============================================================
   FOOTER
   ============================================================= */
.footer { padding-block: clamp(3rem, 8vh, 6rem); border-top: 1px solid var(--line-soft); }
.footer__inner { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 0.8rem; }
.footer__motif { color: var(--ink-faint); opacity: 0.7; }
.footer__name { font-family: var(--display); font-size: 1.2rem; margin: 0.4rem 0 0; }
.footer__copy { font-size: 0.82rem; color: var(--ink-faint); margin: 0; }

/* =============================================================
   RESPONSIVE
   ============================================================= */
@media (max-width: 640px) {
  :root { --section-pad: clamp(4rem, 10vh, 7rem); }
  .node__label { font-size: 17px; }
  .cases__grid { grid-template-columns: 1fr; }
  .connect__link { font-size: 1.5rem; }
}

/* =============================================================
   REDUCED MOTION — kill heavy motion, keep it legible
   ============================================================= */
@media (prefers-reduced-motion: reduce) {
  .scroll-cue__line { animation: none; }
  [data-reveal] { opacity: 1 !important; filter: none !important; transform: none !important; }
  .fd-line { transform: scaleX(1); }
}
