/* ============================================================
   Christopher Brellis — CV site
   Paper, ink, one electric blue. Type does the heavy lifting.
   ============================================================ */

:root {
  --paper: #f4f0e8;
  --paper-deep: #ece7db;
  --ink: #17150f;
  --ink-soft: rgba(23, 21, 15, 0.62);
  --ink-faint: rgba(23, 21, 15, 0.18);
  --accent: #e60000; /* antidot.gr red */
  --serif: "Instrument Serif", Georgia, serif;
  --sans: "Archivo", Helvetica, Arial, sans-serif;
  --mono: "Space Mono", "Courier New", monospace;
  --gutter: clamp(1.25rem, 4vw, 4rem);
  --measure: 42rem;
}

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

/* Images may carry explicit width/height attributes (added by _build/seo.py) so the
   browser can reserve their space before they load. Those attributes double as
   presentational hints, so height is reset to auto here — without it, any rule setting
   only a width would leave the attribute height in force and stretch the picture.
   Rules that set a height deliberately are more specific and still win. */
img { max-width: 100%; height: auto; }

html { scroll-behavior: auto; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: clamp(1rem, 0.95rem + 0.3vw, 1.125rem);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: var(--accent); color: var(--paper); }

a { color: inherit; }

.mono {
  font-family: var(--mono);
  font-size: 0.72em;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.accent { color: var(--accent); }

em { font-family: var(--serif); font-style: italic; font-size: 1.06em; }

sup { font-size: 0.55em; color: var(--accent); }

/* ============ intro curtain ============ */
.curtain {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--ink);
  color: var(--paper);
  display: flex;
  align-items: center;
  justify-content: center;
}
.curtain-word {
  font-family: var(--sans);
  font-weight: 500;
  letter-spacing: -0.03em;
  font-size: clamp(2.6rem, 9vw, 6.5rem);
  overflow: hidden;
  display: flex;
}
.curtain-line, .curtain-dot { display: inline-block; transform: translateY(110%); }
.curtain-dot { color: var(--accent); }

/* ============ floating hover image ============ */
.float-img {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 50;
  width: clamp(220px, 24vw, 340px);
  aspect-ratio: 4 / 3;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  will-change: transform;
}
.float-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border: 1px solid var(--ink);
  box-shadow: 8px 8px 0 var(--accent);
  background: var(--paper-deep);
}

/* ============ header ============ */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 80;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem var(--gutter);
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--ink-faint);
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}
.site-header.is-hidden { transform: translateY(-100%); }

.wordmark {
  font-family: var(--sans);
  font-weight: 600;
  letter-spacing: -0.02em;
  font-size: 1.15rem;
  text-decoration: none;
  white-space: nowrap;
}
.wordmark .dot { color: var(--accent); }

.header-right {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2.4vw, 1.6rem);
}

/* ---- burger ---- */
.burger {
  position: relative;
  width: 26px;
  height: 13px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  color: var(--ink);
  transition: color 0.25s;
  align-self: center;
}
.burger:hover { color: var(--accent); }
.burger-box { position: absolute; inset: 0; }
.burger-box span {
  position: absolute;
  left: 0;
  right: 0;
  height: 1.5px;
  background: currentColor;
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.2s;
}
.burger-box span:nth-child(1) { top: 0; }
.burger-box span:nth-child(2) { bottom: 0; }
.burger.is-open .burger-box span:nth-child(1) { top: 50%; transform: translateY(-50%) rotate(45deg); }
.burger.is-open .burger-box span:nth-child(2) { top: 50%; bottom: auto; transform: translateY(-50%) rotate(-45deg); }

/* ---- menu overlay ---- */
.menu-panel {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(1.4rem, 4vh, 2.6rem);
  padding: 22vh var(--gutter) var(--gutter);
  background: color-mix(in srgb, var(--paper-deep) 95%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.45s ease, visibility 0.45s;
}
.menu-panel.is-open { opacity: 1; visibility: visible; }
.menu-eyebrow { color: var(--ink-soft); }
.menu-nav { display: flex; flex-direction: column; gap: clamp(0.4rem, 1.5vh, 1rem); }
.menu-link {
  font-family: var(--sans);
  font-weight: 600;
  font-size: clamp(2.6rem, 9vw, 5.5rem);
  letter-spacing: -0.035em;
  line-height: 0.98;
  text-decoration: none;
  color: var(--ink);
  width: max-content;
  transition: color 0.25s;
}
.menu-link:hover { color: var(--accent); }
body.menu-lock { overflow: hidden; }
.menu-note {
  margin-top: clamp(1.5rem, 4vh, 2.5rem);
  color: var(--ink-soft);
  font-style: italic;
  text-transform: none;
  letter-spacing: 0.02em;
}

.header-meta { color: var(--ink-soft); white-space: nowrap; }
.header-contact {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink-soft);
  white-space: nowrap;
  transition: color 0.25s;
}
.header-contact:hover { color: var(--accent); }

/* ============ layout ============ */
.section {
  padding: clamp(5rem, 12vh, 9rem) var(--gutter);
  max-width: 90rem;
  margin: 0 auto;
}

.section-label {
  color: var(--ink-soft);
  margin-bottom: clamp(2rem, 5vh, 3.5rem);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.section-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--ink-faint);
}
.label-no { color: var(--accent); font-weight: 700; }

.section-title {
  font-family: var(--sans);
  font-weight: 500;
  font-size: clamp(2rem, 5.5vw, 4.2rem);
  line-height: 1.04;
  letter-spacing: -0.02em;
  margin-bottom: clamp(1.5rem, 4vh, 2.5rem);
}
.section-title em { font-weight: 400; }

/* ============ hero ============ */
.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 7rem var(--gutter) 4rem;
  max-width: 90rem;
  margin: 0 auto;
  position: relative;
}

.hero-kicker { color: var(--ink-soft); margin-bottom: clamp(1.5rem, 4vh, 3rem); }

.hero-title {
  font-weight: 500;
  font-size: clamp(2.7rem, 9.5vw, 8.2rem);
  line-height: 0.98;
  letter-spacing: -0.03em;
}
.hero-line { display: block; overflow: hidden; padding-bottom: 0.06em; margin-bottom: -0.06em; }
.hl-inner { display: inline-block; will-change: transform; }
.hero-title em { font-weight: 400; letter-spacing: -0.01em; }

.hero-foot {
  margin-top: clamp(2.5rem, 7vh, 5rem);
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem 3rem;
}
.hero-intro { max-width: 30rem; font-size: clamp(1.05rem, 1.4vw, 1.3rem); line-height: 1.5; }
.hero-ticker { color: var(--ink-soft); }
.ticker-word { display: inline-block; min-width: 9ch; font-style: normal; font-weight: 700; }

.scroll-hint {
  position: absolute;
  bottom: 1.5rem;
  left: var(--gutter);
  color: var(--ink-soft);
}
.scroll-arrow { display: inline-block; }

/* ============ story ============ */
.story-statement {
  font-size: clamp(1.5rem, 3.4vw, 2.7rem);
  line-height: 1.28;
  font-weight: 400;
  letter-spacing: -0.015em;
  max-width: 62rem;
}
.story-statement + .story-statement {
  margin-top: clamp(0.9rem, 2.4vh, 1.6rem);
}
.story-statement .w {
  display: inline-block;
  opacity: 0.12;
  will-change: opacity;
}
.story-statement mark {
  background: transparent;
  color: inherit;
  background-image: linear-gradient(var(--accent), var(--accent));
  background-repeat: no-repeat;
  background-size: var(--mark-w, 0%) 0.12em;
  background-position: 0 96%;
  transition: background-size 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}
.story-statement mark .w { opacity: 0.12; }

.story-aside {
  margin-top: clamp(2rem, 5vh, 3rem);
  max-width: 34rem;
  margin-left: auto;
  font-family: var(--serif);
  font-size: clamp(1.15rem, 1.8vw, 1.45rem);
  line-height: 1.4;
  color: var(--ink-soft);
  border-left: 2px solid var(--accent);
  padding-left: 1.25rem;
}
.story-aside em { color: var(--ink); }

/* stats */
.stat-strip {
  list-style: none;
  margin-top: clamp(3.5rem, 8vh, 6rem);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--ink-faint);
}
.stat {
  padding: 1.5rem 1rem 0 0;
  border-right: 1px solid var(--ink-faint);
  padding-left: 1rem;
}
.stat:first-child { padding-left: 0; }
.stat:last-child { border-right: none; }
.stat-num {
  display: block;
  font-family: var(--serif);
  font-size: clamp(2.6rem, 6vw, 5rem);
  line-height: 1;
  color: var(--accent);
}
.stat-label { display: block; margin-top: 0.5rem; color: var(--ink-soft); }

/* ============ capabilities ============ */
.caps-list {
  list-style: none;
  margin-top: clamp(2.5rem, 6vh, 4rem);
  border-top: 1px solid var(--ink);
}
.cap-item {
  display: block;
  padding: clamp(1.1rem, 2.7vh, 1.9rem) 0;
  border-bottom: 1px solid var(--ink-faint);
}
.cap-name {
  display: block;
  font-size: clamp(1.4rem, 3vw, 2.1rem);
  font-weight: 600;
  line-height: 1.06;
  letter-spacing: -0.02em;
  transition: color 0.25s ease, transform 0.3s ease;
}
@media (hover: hover) {
  .cap-item:hover .cap-name { color: var(--accent); transform: translateX(0.7rem); }
}
@media (max-width: 560px) {
  .cap-name { font-size: clamp(1.2rem, 6vw, 1.6rem); }
}

/* ============ range ============ */
.range-hint { color: var(--ink-soft); margin: -0.75rem 0 2rem; }

.range-list { list-style: none; border-top: 1px solid var(--ink-faint); }

.range-item {
  border-bottom: 1px solid var(--ink-faint);
  cursor: default;
}
.range-text {
  display: block;
  padding: clamp(0.8rem, 1.6vw, 1.15rem) 0;
  font-size: clamp(1.15rem, 2.6vw, 2rem);
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--ink-soft);
  transition: color 0.25s, transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  transform-origin: left center;
}
.range-item strong { font-weight: 600; color: var(--ink); transition: color 0.25s; }

@media (hover: hover) {
  .range-item[data-img] { cursor: none; }
  .range-item:hover .range-text { color: var(--ink); transform: translateX(0.6rem); }
  .range-item:hover strong { color: var(--accent); }
}

.range-item.is-nda .range-text::after {
  content: " 🔒";
  font-size: 0.6em;
  opacity: 0.45;
}

/* mobile inline image */
.range-inline-img {
  overflow: hidden;
  height: 0;
}
.range-inline-img img {
  width: 100%;
  max-width: 30rem;
  display: block;
  border: 1px solid var(--ink);
  box-shadow: 6px 6px 0 var(--accent);
  margin: 0.25rem 0 1.4rem;
}

.range-footnote { margin-top: 1.25rem; color: var(--ink-soft); }

/* ============ now ============ */
.now-intro { max-width: var(--measure); font-size: clamp(1.1rem, 1.6vw, 1.35rem); margin-bottom: clamp(2.5rem, 6vh, 4rem); }

.now-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
  gap: 1px;
  background: var(--ink-faint);
  border: 1px solid var(--ink-faint);
}
.now-card {
  background: var(--paper);
  padding: clamp(1.5rem, 3vw, 2.5rem);
  transition: background 0.3s;
}
.now-card:hover { background: var(--paper-deep); }
.now-num {
  display: inline-block;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 50%;
  width: 2rem;
  height: 2rem;
  line-height: 2rem;
  text-align: center;
  margin-bottom: 1.25rem;
  font-size: 0.8rem;
}
.now-card h3 {
  font-weight: 600;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
  margin-bottom: 0.75rem;
}
.now-card p { color: var(--ink-soft); font-size: 0.97rem; }
.now-card .now-tags { margin-top: 1.25rem; color: var(--accent); }

/* ============ interlude ============ */
.interlude {
  padding: clamp(6rem, 18vh, 12rem) var(--gutter);
  max-width: 90rem;
  margin: 0 auto;
  text-align: center;
  min-height: 88svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}
.interlude-quote { will-change: transform; }
.interlude-kicker { color: var(--ink-soft); margin-bottom: 1.75rem; }
.interlude-quote {
  font-weight: 500;
  font-size: clamp(2.1rem, 6vw, 4.8rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
}

/* ============ record / timeline ============ */
.timeline { list-style: none; border-top: 1px solid var(--ink-faint); }

.tl-item { border-bottom: 1px solid var(--ink-faint); }

.tl-row {
  display: grid;
  grid-template-columns: 6.5rem 1fr auto;
  gap: 1.25rem;
  align-items: baseline;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  font: inherit;
  color: inherit;
  padding: clamp(1.1rem, 2vw, 1.6rem) 0;
  cursor: pointer;
}
.tl-year { color: var(--ink-soft); font-size: 0.72rem; line-height: 1.5; }
.is-current .tl-year { color: var(--accent); font-weight: 700; }

.tl-org {
  display: block;
  font-size: clamp(1.25rem, 2.6vw, 2rem);
  font-weight: 500;
  letter-spacing: -0.015em;
  transition: color 0.25s;
}
.tl-row:hover .tl-org { color: var(--accent); }
.tl-role { display: block; color: var(--ink-soft); margin-top: 0.3rem; font-size: 0.95rem; }

.tl-toggle {
  font-family: var(--mono);
  font-size: 1.4rem;
  color: var(--accent);
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  align-self: center;
}
.tl-row[aria-expanded="true"] .tl-toggle { transform: rotate(45deg); }

.tl-detail { overflow: hidden; height: 0; }
.tl-detail ul {
  list-style: none;
  padding: 0 0 clamp(1.25rem, 2vw, 1.75rem) 7.75rem;
  max-width: 52rem;
}
.tl-detail li {
  color: var(--ink-soft);
  font-size: 0.97rem;
  padding: 0.35rem 0 0.35rem 1.25rem;
  position: relative;
}
.tl-detail li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.8em;
  top: 0.55em;
}

/* education & extras */
.record-extra {
  margin-top: clamp(3.5rem, 8vh, 6rem);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: clamp(2rem, 4vw, 3.5rem);
}
.extra-head {
  color: var(--accent);
  margin-bottom: 1.1rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--ink-faint);
}
.extra-list { list-style: none; }
.extra-list li {
  color: var(--ink-soft);
  font-size: 0.95rem;
  padding: 0.4rem 0;
}
.extra-list strong { color: var(--ink); font-weight: 600; }

/* ============ contact ============ */
.contact { text-align: left; }
.contact-title {
  font-weight: 500;
  font-size: clamp(2.6rem, 8vw, 6.5rem);
  line-height: 1;
  letter-spacing: -0.03em;
  margin-bottom: clamp(2rem, 5vh, 3rem);
}
.contact-email {
  display: inline-block;
  font-family: var(--serif);
  font-size: clamp(1.6rem, 4.5vw, 3.4rem);
  color: var(--accent);
  text-decoration: none;
  border-bottom: 2px solid var(--accent);
  padding-bottom: 0.1em;
  will-change: transform;
}
.contact-meta { margin-top: 2rem; color: var(--ink-soft); }
.contact-meta a { color: var(--ink); text-decoration-color: var(--accent); }
.contact-meta a:hover { color: var(--accent); }

/* ============ footer marquee ============ */
.site-footer {
  border-top: 1px solid var(--ink-faint);
  overflow: hidden;
}
.marquee {
  padding: 1.4rem 0;
  border-bottom: 1px solid var(--ink-faint);
  white-space: nowrap;
  overflow: hidden;
}
.marquee-track {
  display: inline-flex;
  will-change: transform;
  font-family: var(--serif);
  font-size: clamp(1.2rem, 2.4vw, 1.8rem);
  color: var(--ink-soft);
}
.footer-note {
  padding: 1.25rem var(--gutter) 1.5rem;
  color: var(--ink-soft);
}

/* ============ reveal defaults (JS animates in) ============ */
.js .reveal { opacity: 0; transform: translateY(28px); }
.js .hl-inner { transform: translateY(110%); }
.js .tl-item, .js .range-item { opacity: 0; transform: translateY(20px); }

/* ============ responsive ============ */
@media (max-width: 760px) {
  .stat-strip { grid-template-columns: repeat(2, 1fr); }
  .stat { border-right: none; padding-left: 0; border-top: 1px solid var(--ink-faint); }
  .stat:first-child, .stat:nth-child(2) { border-top: none; }
  .tl-row { grid-template-columns: 1fr auto; }
  .tl-year { grid-column: 1 / -1; }
  .tl-detail ul { padding-left: 0; }
  .scroll-hint { display: none; }
  .header-meta { font-size: 0.65rem; }
}

/* ============ reduced motion ============ */
@media (prefers-reduced-motion: reduce) {
  .js .reveal, .js .hl-inner, .js .tl-item, .js .range-item {
    opacity: 1 !important;
    transform: none !important;
  }
  .curtain { display: none; }
  .story-statement .w { opacity: 1 !important; }
  .story-statement mark { background-size: 100% 0.12em; }
}
