/* parkir, Harbour identity. Source: the Harbour guidelines (mark, colour, type, motion). */

/* ---------- Tokens ---------- */
:root {
  /* Harbour core */
  --paper: #eef2f5;
  --ink: #142338;
  --slate: #5a6a7e;
  --mist: #d5dde5;
  --buoy: #f0643a;          /* the dot only: one per screen */

  /* The page has two zones: a paper top (header, name, photo),
     and harbour navy from the work section down. The roles below are the navy zone; .top and .hero
     switch to the --top-* set. */

  /* roles, day: navy zone */
  --bg: var(--ink);
  --surface: #1a2b44;
  --fg: var(--paper);
  --muted: #93a3b8;
  --line: #26384f;
  --accent: var(--buoy);
  --bar: #3d4f66;           /* past roles */
  --bar-hover: #5a6a7e;
  --bar-selected: #8595a8;
  --cover: #142338;         /* intro cover */
  --cover-fg: #eef2f5;

  /* roles, day: light top zone, paper */
  --top-bg: var(--paper);
  --top-fg: var(--ink);
  --top-muted: #3d4f66;     /* a touch darker than slate for small text */
  --top-line: var(--mist);
  --panel: #142338;         /* the photo panel */
  --panel-fg: #eef2f5;
  --panel-muted: #93a3b8;
  --panel-line: #26384f;

  /* type: Commissioner, 4:3 scale */
  --font: "Commissioner", system-ui, -apple-system, "Segoe UI", sans-serif;
  --t-small: 0.8125rem;
  --t-body: 1rem;
  --t-lead: 1.3125rem;
  --t-title: 1.75rem;
  --t-heading: 2.375rem;
  --t-display: 4rem;
  --w-light: 300;
  --w-text: 360;
  --w-medium: 520;

  /* motion */
  --ease-draw: cubic-bezier(.45, .05, .25, 1);
  --ease-settle: cubic-bezier(.2, .8, .2, 1);
  --ease-buoy: cubic-bezier(.3, 1.6, .5, 1);
  --dur-ui: 240ms;

  --gutter: clamp(1rem, 4vw, 3rem);
  --max: 72rem;
  color-scheme: light;
}

/* One look for everyone: the site does not switch to a dark theme when the visitor's system is in dark mode.
   The navy bottom already gives the page its dark half. */

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: var(--t-body);
  font-weight: var(--w-text);
  line-height: 1.6;
  font-feature-settings: "kern", "liga";
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3 { font-weight: var(--w-medium); margin: 0; text-wrap: balance; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
.defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.buoy { fill: var(--accent); }
.wrap { width: min(100% - 2 * var(--gutter), var(--max)); margin-inline: auto; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.print-only { display: none; }

/* Links: a quiet mist underline, and an orange line that runs across on hover or focus. */
a { color: inherit; }
.nav a, .links a, .mail a {
  text-decoration: none;
  background:
    linear-gradient(var(--accent), var(--accent)) left bottom / 0% 2px no-repeat,
    linear-gradient(var(--line), var(--line)) left bottom / 100% 1px no-repeat;
  padding-bottom: .12em;
  transition: background-size .32s var(--ease-settle);
}
.nav a:hover, .links a:hover, .mail a:hover,
.nav a:focus-visible, .links a:focus-visible, .mail a:focus-visible { background-size: 100% 2px, 100% 1px; }

.skip {
  position: absolute; left: 1rem; top: -3rem; z-index: 60;
  background: var(--fg); color: var(--bg); padding: .5rem .8rem; border-radius: 4px;
}
.skip:focus { top: 1rem; }

/* ---------- Zones ---------- */
/* The light top runs edge to edge behind the header and the hero (box-shadow band, clipped so it never scrolls sideways). */
.top, .hero {
  --bg: var(--top-bg); --fg: var(--top-fg); --muted: var(--top-muted); --line: var(--top-line);
  background: var(--top-bg); color: var(--fg);
  box-shadow: 0 0 0 100vmax var(--top-bg);
  clip-path: inset(0 -100vmax);
}

/* ---------- Header ---------- */
.top { display: flex; justify-content: space-between; align-items: center; padding-top: clamp(1.25rem, 3vw, 2rem); }
.logo { display: block; color: var(--fg); border-radius: 4px; }
.logo svg { display: block; height: 44px; width: auto; aspect-ratio: 126 / 100; }
.nav { display: flex; gap: clamp(1.25rem, 3vw, 2rem); font-size: .9375rem; }

/* ---------- Hero ---------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: clamp(2rem, 6vw, 5rem);
  align-items: end;
  padding-block: clamp(3rem, 8vw, 6rem) clamp(3rem, 8vw, 6rem);
}
.name {
  font-size: clamp(2.75rem, 8vw, var(--t-display));
  line-height: 1;
  letter-spacing: -.03em;
}
.name span { display: block; }
.name-gr { color: var(--muted); font-size: 1.25rem; margin-top: 1rem; }
/* A small outlined tag, drawn like the study bars on the timeline, so the second name reads as the Greek version. */
.name-gr-label {
  display: inline-block; margin-right: .55em; padding: .2em .45em .15em;
  border: 1px solid currentColor; border-radius: 3px;
  font-size: .75rem; font-weight: var(--w-head); letter-spacing: .06em; line-height: 1;
  text-decoration: none; vertical-align: .2em; cursor: help;
}
.lede {
  font-size: var(--t-lead);
  font-weight: var(--w-light);
  line-height: 1.45;
  max-width: 30em;
  margin-top: 2rem;
}
/* The first paragraph is the hello; the rest read as ordinary text, a step down. */
.lede p + p { margin-top: .9em; font-size: var(--t-body); font-weight: var(--w-text); line-height: 1.6; color: var(--muted); max-width: 36em; }
/* The portrait sits in a navy panel, like a print in a passe-partout, so the warm wall of the photo
   never touches the cool page. The caption carries the pk symbol (no orange: the buoy stays in the header). */
.portrait {
  margin: 0;
  position: relative;
  background: var(--panel);
  padding: 12px 12px 44px;
  border-radius: 4px;
}
.portrait img {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  object-position: 50% 20%;
  border-radius: 2px;
  background: var(--panel-line);
}
.portrait figcaption {
  position: absolute; left: 14px; right: 14px; bottom: 13px;
  display: flex; justify-content: space-between; align-items: center;
  color: var(--panel-muted); font-size: var(--t-small); letter-spacing: .01em;
}
.portrait figcaption svg { height: 19px; width: auto; color: var(--panel-fg); display: block; margin-left: auto; }

/* ---------- Work ---------- */
.work { padding-block: clamp(3rem, 7vw, 5.5rem); }
.section-head {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline;
  gap: .5rem 2rem; margin-bottom: clamp(1.75rem, 4vw, 2.5rem);
}
.section-head h2 { font-size: var(--t-heading); line-height: 1.1; letter-spacing: -.02em; }
.hint { color: var(--muted); font-size: .9375rem; }

/* Without JavaScript: two plain lists, work then study. */
.lane-title { font-size: var(--t-body); font-weight: var(--w-medium); color: var(--muted); margin: 0 0 1rem; }
.studies + .lane-title, .roles + .lane-title { margin-top: 2.5rem; }
.timeline.is-strip .lane-title { display: none; }
.roles { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.75rem; }
.role { display: grid; gap: .25rem; max-width: 44rem; }
.role-title { font-size: 1.25rem; line-height: 1.25; letter-spacing: -.01em; }
.role-meta { color: var(--muted); font-size: .9375rem; }
.role-desc { margin-top: .4rem; font-weight: var(--w-light); font-size: 1.0625rem; max-width: 36em; }

/* With JavaScript: the strip, plus the selected role only. */
.timeline.is-strip .roles { display: block; }
.timeline.is-strip .role { display: none; }
.timeline.is-strip .role.is-selected {
  display: grid;
  grid-template-columns: minmax(0, 26rem) minmax(0, 1fr);
  grid-template-areas: "title desc" "meta desc" "steps overlap";
  grid-template-rows: auto auto 1fr;
  column-gap: clamp(2rem, 6vw, 4rem);
  row-gap: .35rem;
  max-width: none;
  margin-top: clamp(1.75rem, 4vw, 2.5rem);
}
.timeline.is-strip .role-title { grid-area: title; font-size: var(--t-title); line-height: 1.15; letter-spacing: -.015em; }
.timeline.is-strip .role-meta { grid-area: meta; }
.timeline.is-strip .role-desc { grid-area: desc; margin-top: .35rem; font-size: 1.125rem; line-height: 1.6; }
.timeline.is-strip .steps { grid-area: steps; }
.timeline.is-strip .role-overlap { grid-area: overlap; }

/* "At the same time": the overlap written out, linking to the other lane. */
.role-overlap { display: flex; flex-wrap: wrap; align-items: baseline; gap: .35rem 1rem; margin: .9rem 0 0; font-size: .9375rem; }
.ov-label { width: 100%; color: var(--muted); font-size: var(--t-small); }
.role-overlap button {
  font: inherit; color: var(--fg); background: none; border: 0; padding: .15rem 0; cursor: pointer; text-align: left;
  text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: .25em; text-decoration-thickness: 1px;
  transition: text-decoration-color var(--dur-ui) var(--ease-settle);
}
.role-overlap button:hover, .role-overlap button:focus-visible { text-decoration-color: var(--accent); }

.strip { --bar-h: 56px; --study-h: 30px; --bridge-h: 26px; position: relative; }
/* The management years: a bracket over the work lane from the first lead role to today. */
.lead { position: relative; height: 2.1rem; margin-bottom: .35rem; }
.lead-span {
  position: absolute; top: 0; bottom: 0;
  border-top: 2px solid var(--fg); border-left: 2px solid var(--fg); border-right: 2px solid var(--fg);
  border-radius: 3px 3px 0 0; transform-origin: left;
}
.lead-span span {
  position: absolute; left: .55rem; top: .35rem; white-space: nowrap;
  font-size: .8125rem; font-weight: var(--w-head); color: var(--fg);
}
.orgs { position: relative; height: 1.9rem; }
.org {
  position: absolute; top: 0;
  font-size: .8125rem; font-weight: 500; white-space: nowrap;
  border-bottom: 1px solid var(--line); padding-bottom: .3rem;
}
.org.is-last { text-align: right; direction: rtl; }
.org.is-hidden { visibility: hidden; }
.track {
  position: relative; height: var(--bar-h); margin-top: .5rem;
  background-image: linear-gradient(to right, var(--line) 1px, transparent 1px);
  background-size: calc(100% / var(--years, 14)) 100%;
  box-shadow: inset -1px 0 0 var(--line);
}
.bar {
  position: absolute; top: 0; bottom: 0;
  min-width: 5px; margin: 0; padding: 0; border: 0; border-radius: 1px;
  background: var(--bar);
  cursor: pointer;
  transform-origin: left center;
  transition: background-color var(--dur-ui) var(--ease-settle);
}
.bar:hover { background: var(--bar-hover); }
.bar[aria-pressed="true"] { background: var(--bar-selected); }
.bar.is-current, .bar.is-current:hover, .bar.is-current[aria-pressed="true"] { background: var(--fg); }
.bar:focus-visible { outline-offset: 3px; }
.bar[aria-pressed="true"]::after {
  /* a small tick under the selected bar */
  content: ""; position: absolute; left: 0; right: 0; bottom: -9px; height: 2px; background: var(--fg); border-radius: 1px;
}

/* Study lane: thinner, outlined bars, so a degree never reads as a job. */
.track.lane-study { height: var(--study-h); margin-top: 0; }
.bar.is-study {
  display: flex; align-items: center; padding: 0 .55rem; overflow: hidden;
  background: var(--bg); color: var(--muted);
  box-shadow: inset 0 0 0 1.5px var(--bar-selected);
  font: 500 .75rem/1 var(--font); white-space: nowrap;
}
.bar.is-study:hover { background: var(--bg); box-shadow: inset 0 0 0 1.5px var(--fg); color: var(--fg); }
.bar.is-study[aria-pressed="true"] { background: var(--bar-selected); color: var(--bg); box-shadow: none; }
.orgs-study { height: 1.7rem; margin-top: .45rem; }
.orgs-study .org { border-bottom: 0; border-top: 1px solid var(--line); padding: .3rem 0 0; }

/* The overlap: a woven bridge between the lanes wherever study and work run at the same time. */
.bridges { position: relative; height: var(--bridge-h); }
.bridge {
  position: absolute; top: 0; bottom: 0; cursor: pointer;
  --weave: var(--bar-hover);
  background:
    repeating-linear-gradient(115deg, var(--weave) 0 1.5px, transparent 1.5px 7px),
    linear-gradient(var(--weave), var(--weave)) left / 1px 100% no-repeat,
    linear-gradient(var(--weave), var(--weave)) right / 1px 100% no-repeat;
  transform-origin: center;
  transition: opacity var(--dur-ui) var(--ease-settle);
}
.bridge:hover { --weave: var(--bar-selected); }
.bridge.is-active { --weave: var(--fg); }

/* Spotlight: when the selection has an overlap, everything outside it steps back. */
.bar, .bridge { transition: background-color var(--dur-ui) var(--ease-settle), opacity .35s var(--ease-settle), box-shadow var(--dur-ui) var(--ease-settle); }
.strip.has-overlap .bar:not([aria-pressed="true"]):not(.is-concurrent),
.strip.has-overlap .bridge:not(.is-active) { opacity: .4; }
.bar.is-concurrent:not(.is-study) { box-shadow: inset 0 0 0 2px var(--fg); }
.bar.is-study.is-concurrent { box-shadow: inset 0 0 0 2px var(--fg); color: var(--fg); }

.now {
  position: absolute; top: 50%;
  width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--bg);
  pointer-events: none;
}
.years { position: relative; height: 1.4rem; margin-top: 1rem; font-size: .8125rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.years span { position: absolute; top: 0; transform: translateX(-50%); }

.steps { display: flex; gap: 1.25rem; margin-top: .6rem; }
.steps button {
  font: inherit; font-size: .9375rem; color: var(--fg);
  background: none; border: 0; padding: .2rem 0; cursor: pointer;
  text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: .25em; text-decoration-thickness: 1px;
  transition: text-decoration-color var(--dur-ui) var(--ease-settle);
}
.steps button:hover { text-decoration-color: var(--accent); }
.steps button:disabled { color: var(--muted); opacity: .5; cursor: default; text-decoration: none; }

/* One orchestrated moment: work grows, then study, then the bridges weave in between them,
   then the buoy drops on today. */
@media (prefers-reduced-motion: no-preference) {
  .strip.play .bar { animation: grow .9s var(--ease-settle) both; animation-delay: calc(var(--i) * 70ms); }
  .strip.play .bridge { animation: weave .6s var(--ease-draw) both; animation-delay: calc(var(--n) * 70ms + .35s + var(--k) * 140ms); }
  .strip.play .lead-span { animation: grow .8s var(--ease-draw) both; animation-delay: calc(var(--n) * 70ms + .2s); }
  .strip.play .now { animation: drop .46s var(--ease-buoy) both; animation-delay: calc(var(--n) * 70ms + var(--b) * 140ms + .85s); }
}
@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes weave { from { transform: scaleY(0); clip-path: inset(0 50% 0 50%); } to { transform: scaleY(1); clip-path: inset(0 0 0 0); } }
@keyframes drop { from { transform: translateY(-16px) scale(.35); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- Contact ---------- */
.contact { border-top: 1px solid var(--line); padding-block: clamp(3rem, 7vw, 5.5rem); }
.mail {
  font-size: clamp(1.5rem, 5vw, var(--t-heading));
  font-weight: var(--w-medium);
  letter-spacing: -.02em;
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.links { list-style: none; margin: 1.5rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem 2rem; font-size: 1.0625rem; }

/* ---------- Footer ---------- */
.foot {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem;
  border-top: 1px solid var(--line);
  padding-block: 1.5rem 2.5rem;
  color: var(--muted); font-size: .9375rem;
}

/* ---------- Intro: the mark draws on navy, then shrinks into the header ---------- */
.intro-cover { display: none; }
html.intro .intro-cover {
  display: block; position: fixed; inset: 0; z-index: 50;
  /* safety net: if main.js never runs, the cover still goes away */
  animation: intro-safety .01s 5.5s forwards;
}
html.intro .intro-cover::before { content: ""; position: absolute; inset: 0; background: var(--cover); transition: opacity .75s var(--ease-settle); }
html.intro .intro-cover.is-leaving::before { opacity: 0; }
html.intro .logo { visibility: hidden; }
.intro-mark {
  position: absolute; left: 50%; top: 50%;
  width: min(42vw, 240px);
  transform: translate(-50%, -50%);
  transform-origin: 0 0;
  color: var(--cover-fg);
}
.intro-mark svg { display: block; width: 100%; height: auto; overflow: visible; }
.intro-mark.is-moving { transition: transform .95s var(--ease-settle), color .75s var(--ease-settle); color: var(--top-fg); }
html.intro .intro-mark .s { stroke-dasharray: 1; animation: draw .75s var(--ease-draw) both; }
html.intro .intro-mark .s1 { animation-duration: .85s; }
html.intro .intro-mark .s2 { animation-delay: .45s; }
html.intro .intro-mark .s3 { animation-delay: .7s; }
html.intro .intro-mark .s4 { animation-delay: .95s; }
html.intro .intro-mark .buoy { animation: drop .55s 1.5s var(--ease-buoy) both; transform-box: fill-box; transform-origin: center; }
@keyframes draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes intro-safety { to { visibility: hidden; } }

/* ---------- Small screens ---------- */
@media (max-width: 760px) {
  .logo svg { height: 38px; }
  /* The bracket is too short for its label here: set the label just outside, to its left. */
  .lead-span span { left: auto; right: calc(100% + .6rem); top: -.15rem; }
  .hero { grid-template-columns: 1fr; align-items: start; padding-top: 2rem; }
  .portrait { order: -1; width: min(60%, 15rem); }
  .lede { font-size: 1.1875rem; margin-top: 1.5rem; }
  .strip { --bar-h: 40px; --study-h: 24px; --bridge-h: 18px; }
  .bar.is-study { padding: 0 .35rem; font-size: .6875rem; }
  .org { font-size: .6875rem; }
  .years span:nth-child(3n + 2), .years span:nth-child(3n + 3) { display: none; }
  .timeline.is-strip .role.is-selected { grid-template-columns: 1fr; grid-template-areas: "title" "meta" "desc" "overlap" "steps"; grid-template-rows: none; }
  .timeline.is-strip .role-title { font-size: 1.5rem; }
  .timeline.is-strip .role-desc { font-size: 1.0625rem; }
}

/* ---------- Print: a one-page CV ---------- */
@media print {
  :root, .top, .hero { --bg: #fff; --fg: #000; --muted: #444; --line: #bbb; --accent: #000; --bar: #999; }
  body, .top, .hero { background: #fff !important; color: #000; box-shadow: none !important; clip-path: none !important; }
  @page { margin: 14mm; }
  body { font-size: 10pt; line-height: 1.45; }
  .skip, .nav, .hint, .strip, .steps, .role-overlap, .intro-cover { display: none !important; }
  .timeline.is-strip .lane-title, .lane-title { display: block !important; font-size: 12pt; color: var(--fg); margin: 4mm 0 2mm; }
  .top { padding: 0 0 4mm; }
  .logo svg { height: 12mm; }
  .hero { grid-template-columns: 1fr 26mm; gap: 8mm; padding: 0 0 5mm; }
  .portrait { order: 0; width: auto; background: none; padding: 0; }
  .portrait figcaption { display: none; }
  .name { font-size: 24pt; }
  .name span { display: inline; }
  .name-gr { font-size: 11pt; margin-top: 1mm; }
  .lede { font-size: 11pt; margin-top: 3mm; }
  .work, .contact { padding-block: 4mm; }
  .section-head { margin-bottom: 2mm; }
  .section-head h2, .print-only h2 { font-size: 14pt; }
  .timeline.is-strip .role, .role { display: grid !important; grid-template-columns: 1fr !important; grid-template-areas: none !important; margin: 0 !important; gap: 0 !important; break-inside: avoid; }
  .roles { display: grid !important; gap: 2.5mm; }
  .timeline.is-strip .role-title, .role-title { font-size: 11pt; }
  .timeline.is-strip .role-desc, .role-desc { font-size: 10pt; margin: .5mm 0 0; }
  .print-only { display: block; margin-top: 5mm; }
  .print-only h2 { margin: 3mm 0 1mm; }
  .print-only b { font-weight: 560; }
  .mail { font-size: 12pt; }
  .links { margin-top: 1mm; font-size: 10pt; }
  .links a::after { content: " (" attr(href) ")"; color: var(--muted); }
  .nav a, .links a, .mail a { background: none; }
  .foot { padding-block: 3mm 0; }
}
