/* ============================================================
   Senad Salkanović — CV
   Horizontal scrollytelling layout, light/dark theme
   ============================================================ */

/* Self-hosted fonts. Both are variable, so one file per subset covers the
   whole weight range — no third-party origin, no blocking CSS round-trip. */
@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url(../assets/fonts/spacegrotesk-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url(../assets/fonts/spacegrotesk-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 400 700;
  font-stretch: 100%;
  font-display: swap;
  src: url(../assets/fonts/archivo-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 400 700;
  font-stretch: 100%;
  font-display: swap;
  src: url(../assets/fonts/archivo-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #f6f3ee;
  --ink: #171f28;
  --body-soft: #45403a;
  --accent: #1f5560;
  --accent-strong: #163e46;
  --tint: #e7ddcd;
  --muted: #8a8074;
  --line: #ddd3c3;

  --contrast-bg: #1f5560;
  --contrast-text: #b3c2d3;
  --contrast-line: #3a6d76;
  --contrast-muted: #cdae99;
  --contrast-accent: #dcb9a0;

  --slot-hi: #2c4650;
  --slot-lo: #131a24;
  --slot-num: #eef0f4;

  /* skill-chip category tints: language / tool / OS */
  --cat-lang: var(--accent);
  --cat-tool: #a5673c;
  --cat-os:   #4a6b8a;

  --font-display: "Space Grotesk", "Segoe UI", sans-serif;
  --font-body: "Archivo", "Segoe UI", sans-serif;

  --head-h: 92px;
  --ease-out: cubic-bezier(.19, 1, .22, 1);
}

:root[data-theme="dark"] {
  --bg: #181f29;
  --ink: #ddd5c8;
  --body-soft: #aba297;
  --accent: #7eada9;
  --accent-strong: #9cc4c0;
  --tint: #292420;
  --muted: #838a99;
  --line: #2b3441;

  --slot-hi: #2c4650;
  --slot-lo: #0f151d;

  --cat-tool: #d1a273;
  --cat-os:   #8ba7c6;
}

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

*, *::before, *::after {
  transition: background-color .3s ease, border-color .3s ease, color .3s ease;
}

html { scrollbar-width: thin; scrollbar-color: var(--accent) var(--bg); }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; }
img { max-width: 100%; display: block; }
button { font: inherit; background: none; border: none; cursor: pointer; color: inherit; }

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

/* ============ Header ============ */

.site-head {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--head-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 48px;
  z-index: 50;
  pointer-events: none;
}
.site-head > * { pointer-events: auto; }

.logo { display: flex; align-items: center; gap: 14px; }
.logo__mark { position: relative; width: 42px; height: 32px; display: block; }
.logo__sq { position: absolute; display: block; }
.logo__sq--a {
  left: 0; top: 0;
  width: 26px; height: 26px;
  background: var(--accent);
  clip-path: polygon(0 0, calc(100% - 9px) 0, 100% 9px, 100% 100%, 0 100%);
  transition: transform .6s var(--ease-out), background-color .3s;
}
.logo__sq--b {
  right: 0; bottom: 0;
  width: 18px; height: 18px;
  border: 2px solid var(--ink);
  background: var(--bg);
  transition: transform .6s var(--ease-out) .05s, border-color .3s, background-color .3s;
}
.logo:hover .logo__sq--a { transform: translate(-3px, -2px); }
.logo:hover .logo__sq--b { transform: translate(3px, 2px); }
.logo__text {
  font-weight: 700;
  font-size: 13px;
  line-height: 1.15;
  text-transform: uppercase;
  letter-spacing: .06em;
  opacity: 0;
  transform: translateX(-8px);
  transition: opacity .5s, transform .5s var(--ease-out), color .3s;
}
body.scrolled .logo__text { opacity: 1; transform: none; }

.site-nav { display: flex; gap: clamp(14px, 2.2vw, 38px); }
.site-nav a {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .04em;
  padding: 6px 2px;
  position: relative;
  white-space: nowrap;
}
.site-nav a::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform .35s var(--ease-out);
}
.site-nav a:hover::after,
.site-nav a.active::after { transform: scaleX(1); transform-origin: left; }

.head-right { display: flex; align-items: center; gap: 20px; }

.counter {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .25em;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.counter #counter-cur { color: var(--accent); }

.theme-toggle {
  width: 34px; height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink);
  transition: border-color .3s, color .3s, transform .4s var(--ease-out);
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); transform: rotate(20deg); }
:root[data-theme="light"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* ============ Horizontal scroll machinery ============ */

.hscroll-viewport {
  position: fixed;
  inset: 0;
  overflow: hidden;
}

.track {
  display: flex;
  height: 100%;
  will-change: transform;
}

.panel {
  position: relative;
  flex: 0 0 auto;
  width: 100vw;
  height: 100%;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding: var(--head-h) clamp(32px, 6vw, 110px) 60px;
}
.panel--wide { width: 150vw; }
/* give the projects panel extra room when a card expands to the side */
.panel--wide:has(.card--open) { width: 200vw; }

.panel__inner { position: relative; width: 100%; z-index: 2; }

.panel__inner--split {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: clamp(40px, 6vw, 120px);
  align-items: center;
}

.panel--wide .panel__inner {
  display: flex;
  gap: clamp(40px, 5vw, 100px);
  align-items: center;
}
.panel__intro { flex: 0 0 auto; }

/* Ghost background word */
.ghost {
  position: absolute;
  bottom: 4vh;
  left: 4vw;
  z-index: 1;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(100px, 16vw, 230px);
  line-height: 1;
  letter-spacing: -.02em;
  color: transparent;
  -webkit-text-stroke: 1px var(--line);
  text-stroke: 1px var(--line);
  user-select: none;
  pointer-events: none;
  white-space: nowrap;
}

/* ============ Typography ============ */

.display {
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  line-height: .96;
  letter-spacing: -.03em;
  font-size: clamp(48px, 7vw, 108px);
  margin: 18px 0 28px;
}
.display--md { font-size: clamp(36px, 5vw, 76px); }
.display__line { display: block; }
.display__line--accent { color: var(--accent); }

.label {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--ink);
}
.label__line { display: inline-block; width: 70px; height: 1px; background: var(--accent); }
.label__arrow { color: var(--accent); letter-spacing: 0; }
.label__slash { color: var(--accent); font-weight: 700; letter-spacing: .05em; }

.body-lg {
  font-size: clamp(16px, 1.35vw, 20px);
  max-width: 52ch;
  color: var(--body-soft);
}

.quote {
  margin-top: 28px;
  font-size: clamp(19px, 1.8vw, 26px);
  font-weight: 600;
  line-height: 1.35;
  color: var(--accent);
  max-width: 40ch;
}

/* ============ Reveal animations ============ */

.reveal {
  opacity: 0;
  transform: translateX(80px);
  transition:
    opacity .9s var(--ease-out) var(--d, 0s),
    transform .9s var(--ease-out) var(--d, 0s);
}
.panel.in .reveal,
body.archive .in .reveal { opacity: 1; transform: none; }

/* ============ Shapes / image slots ============ */

.cut-tl { clip-path: polygon(44px 0, 100% 0, 100% 100%, 0 100%, 0 44px); }
.cut-tr { clip-path: polygon(0 0, calc(100% - 44px) 0, 100% 44px, 100% 100%, 0 100%); }
.cut-bl { clip-path: polygon(0 0, 100% 0, 100% 100%, 44px 100%, 0 calc(100% - 44px)); }
.cut-br { clip-path: polygon(0 0, 100% 0, 100% calc(100% - 44px), calc(100% - 44px) 100%, 0 100%); }

.shape { position: absolute; display: block; }
.shape--tint { background: var(--tint); }
.shape--ring {
  background: transparent;
  border: 2px solid var(--accent);
  border-radius: 50%;
}
.shape--diamond {
  background: var(--accent);
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
}

.img-slot {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(120% 120% at 20% 15%, var(--slot-hi) 0%, var(--slot-lo) 70%);
  display: flex;
  align-items: center;
  justify-content: center;
  filter: grayscale(1);
}
.img-slot img { width: 100%; height: 100%; object-fit: cover; }
.img-slot > span {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 64px;
  color: var(--slot-num);
  opacity: .16;
  letter-spacing: .05em;
}

/* Hero composition */
.panel--hero .panel__inner { max-width: 58%; }
.hero__sub { font-size: clamp(15px, 1.3vw, 19px); color: var(--muted); font-weight: 500; }

.hero__portrait {
  position: absolute;
  right: clamp(32px, 8vw, 140px);
  top: 50%;
  transform: translateY(-50%);
  width: clamp(260px, 26vw, 420px);
  aspect-ratio: 3 / 3.6;
  z-index: 2;
}
.panel.in .hero__portrait { transform: translateY(-50%); }
.hero__portrait .img-slot { width: 100%; height: 100%; }
.hero__portrait .shape--ring { width: 34%; aspect-ratio: 1; left: -13%; bottom: -6%; z-index: -1; }
.hero__portrait .shape--diamond { width: 18%; aspect-ratio: 1; right: -8%; top: -6%; }

.scroll-hint {
  position: absolute;
  right: clamp(32px, 6vw, 110px);
  bottom: 40px;
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--muted);
}
.scroll-hint__arrow {
  width: 90px; height: 1px;
  background: var(--accent);
  position: relative;
  animation: hint-slide 2.2s var(--ease-out) infinite;
}
.scroll-hint__arrow::after {
  content: "";
  position: absolute;
  right: 0; top: -3.5px;
  border: solid var(--accent);
  border-width: 1px 1px 0 0;
  width: 7px; height: 7px;
  transform: rotate(45deg);
}
@keyframes hint-slide {
  0%, 100% { transform: translateX(0); opacity: 1; }
  50% { transform: translateX(14px); opacity: .6; }
}

/* About composition */
.panel__col--media { display: flex; flex-direction: column; gap: 34px; }
.composition { position: relative; width: min(340px, 80%); }
.img-slot--tall { width: 100%; aspect-ratio: 3 / 3.4; }
.composition .shape--tint { width: 34%; aspect-ratio: 1; left: -12%; bottom: -10%; }
.composition .shape--ring { width: 24%; aspect-ratio: 1; right: -9%; top: -8%; }

.facts { border-top: 1px solid var(--line); }
.facts li {
  display: flex;
  gap: 18px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.facts em {
  font-style: normal;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: 11px;
  color: var(--accent);
  flex: 0 0 110px;
  padding-top: 2px;
}

/* ============ Experience / timeline ============ */

.timeline {
  position: relative;
  display: flex;
  gap: clamp(30px, 3.5vw, 70px);
  align-items: flex-start;
  padding-top: 46px;
}
.timeline__rail {
  position: absolute;
  top: 14px; left: 0; right: 0;
  height: 1px;
  background: var(--line);
}
.timeline__rail::after {
  content: "";
  position: absolute;
  right: -1px; top: -3.5px;
  border: solid var(--accent);
  border-width: 1px 1px 0 0;
  width: 7px; height: 7px;
  transform: rotate(45deg);
}

.job { position: relative; width: clamp(230px, 20vw, 330px); flex: 0 0 auto; }
.job--featured { width: clamp(320px, 30vw, 500px); }

.job__dot {
  position: absolute;
  top: -37px; left: 0;
  width: 9px; height: 9px;
  background: var(--accent);
  border-radius: 50%;
}

.job__date {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .22em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 10px;
}
.job__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(18px, 1.5vw, 25px);
  text-transform: uppercase;
  letter-spacing: -.01em;
  line-height: 1.08;
  margin-bottom: 6px;
}
.job__org { font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 14px; }
.job__list li {
  position: relative;
  font-size: 13.5px;
  padding: 0 0 10px 0;
  color: var(--body-soft);
  text-align: justify;
  -webkit-hyphens: auto;
  hyphens: auto;
}

/* ============ Projects / cards ============ */

.cards { display: flex; gap: clamp(24px, 2.6vw, 48px); align-items: stretch; }

.card {
  display: flex;
  flex-direction: column;
  width: clamp(230px, 19vw, 310px);
  flex: 0 0 auto;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  transition: transform .5s var(--ease-out), border-color .5s;
}
.card:hover { transform: translateY(-10px); border-color: var(--accent); }

/* primary column — holds media, title, meta; always a vertical stack */
.card__col { display: flex; flex-direction: column; flex: 1 1 auto; min-width: 0; }
a.card__media { display: block; }
.card__title a { color: inherit; transition: color .3s ease; }
.card__title a:hover { color: var(--accent); }

.card__media {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  background:
    radial-gradient(130% 130% at 25% 20%, var(--slot-hi) 0%, var(--slot-lo) 70%);
  margin-bottom: 20px;
  overflow: hidden;
  transition: clip-path .5s var(--ease-out), background-color .3s;
}
.card__media--tint { background: var(--tint); }
.card:hover .card__media.cut-tl { clip-path: polygon(0px 0, 100% 0, 100% 100%, 0 100%, 0 0px); }
.card:hover .card__media.cut-tr { clip-path: polygon(0 0, calc(100% - 0px) 0, 100% 0px, 100% 100%, 0 100%); }
.card:hover .card__media.cut-bl { clip-path: polygon(0 0, 100% 0, 100% 100%, 0px 100%, 0 calc(100% - 0px)); }
.card:hover .card__media.cut-br { clip-path: polygon(0 0, 100% 0, 100% calc(100% - 0px), calc(100% - 0px) 100%, 0 100%); }
.card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1) contrast(1.05);
  transform: scale(1.04);
  transition: filter .5s var(--ease-out), transform .6s var(--ease-out);
}
.card:hover .card__media img { filter: grayscale(0) contrast(1.05); transform: scale(1.1); }
.card__num {
  position: absolute;
  right: 16px; bottom: 8px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 54px;
  color: var(--slot-num);
  opacity: .22;
  z-index: 1;
}
.card__media--tint .card__num { color: var(--ink); opacity: .2; }
.card__media:has(img) .card__num { color: var(--bg); opacity: .55; text-shadow: 0 2px 10px rgba(0,0,0,.5); }

.card__title {
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: -.01em;
  font-size: 20px;
  margin-bottom: 8px;
}
.card__desc { font-size: 13.5px; color: var(--body-soft); text-align: justify; -webkit-hyphens: auto; hyphens: auto; }
.card__desc + .card__desc { margin-top: 8px; }
.card__foot { margin-top: auto; padding-top: 14px; }
.card__tags {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
}
.card__cta {
  display: inline-block;
  margin-top: 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--accent);
  transition: color .3s ease;
}
a.card__cta:hover { color: var(--accent-strong); }

/* ---- expandable long-content card ----
   Drawer effect: the description is pre-laid-out at its FINAL width and the
   column slides open like a curtain. The text never re-wraps mid-animation,
   so nothing jumps around — it is simply revealed. */
.card--expandable {
  --more-w: clamp(300px, 24vw, 380px);
  flex-direction: row;
  align-items: stretch;
  width: auto;                 /* col basis + drawer width drive the size */
}
.card--expandable .card__col { flex: 0 0 clamp(230px, 19vw, 310px); }

.card__more {
  flex: 0 0 auto;
  width: 0;
  max-height: 0;               /* released instantly on open, and only after
                                  the drawer has fully closed again */
  margin-left: 0;
  align-self: center;
  overflow: hidden;
  opacity: 0;
  transition: width .55s var(--ease-out), margin-left .55s var(--ease-out),
              opacity .3s ease, max-height 0s linear .55s;
  scrollbar-width: thin;
  scrollbar-color: var(--accent) transparent;
}
/* fixed-width blocks = no re-wrapping while the drawer moves */
.card__more .card__block { width: var(--more-w); padding-right: 10px; }
.card--open .card__more {
  width: var(--more-w);
  max-height: 66vh;
  margin-left: clamp(22px, 2.2vw, 40px);
  overflow-y: auto;
  opacity: 1;
  transition: width .55s var(--ease-out), margin-left .55s var(--ease-out),
              opacity .5s ease .12s, max-height 0s;
}
.card__block { margin-bottom: 16px; }
.card__block:last-child { margin-bottom: 0; }
.card__block-h {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 4px;
}
.card__block p { font-size: 14.5px; color: var(--body-soft); line-height: 1.6; text-align: justify; -webkit-hyphens: auto; hyphens: auto; }

.card__toggle {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0 12px;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent);
  transition: color .3s ease;
}
.card__toggle:hover { color: var(--accent-strong); }
.card__toggle-ico { position: relative; width: 13px; height: 13px; flex: none; }
.card__toggle-ico::before,
.card__toggle-ico::after {
  content: "";
  position: absolute;
  background: currentColor;
  transition: transform .4s var(--ease-out), opacity .4s;
}
.card__toggle-ico::before { top: 6px; left: 0; width: 13px; height: 1.6px; }
.card__toggle-ico::after  { left: 6px; top: 0; width: 1.6px; height: 13px; }
.card--open .card__toggle-ico::after { transform: scaleY(0); opacity: 0; }

/* ============ Skills ============ */

.stack {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  max-width: 640px;
}
/* compact, pill-shaped chips, tinted by category — used site-wide */
.stack__item {
  --chip: var(--ink);
  font-family: var(--font-body);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-size: 11px;
  line-height: 1.35;
  padding: 4px 11px 5px;
  border: 1px solid var(--chip);
  border-radius: 999px;
  color: var(--chip);
  transition: background .35s, color .35s, transform .35s var(--ease-out), border-color .35s;
}
.stack__item:hover { background: var(--chip); color: var(--bg); transform: translateY(-2px); }

/* category tints — programming language / tool / operating system */
.stack__item--lang { --chip: var(--cat-lang); }
.stack__item--tool { --chip: var(--cat-tool); }
.stack__item--os   { --chip: var(--cat-os); }

.stack__item--accent { --chip: var(--accent); }
.stack__item--outline { color: transparent; -webkit-text-stroke: 1px var(--chip); }
.stack__item--outline:hover { color: var(--bg); -webkit-text-stroke: 0; }

.card .stack { margin: 2px 0 4px; max-width: none; }

.langs { margin-top: 40px; max-width: 360px; border-top: 1px solid var(--line); }
.langs__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.langs__row em {
  font-style: normal;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  font-size: 12px;
}
.langs__row span { color: var(--accent); font-weight: 600; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; }

/* ============ Education ============ */

.edu { display: flex; gap: clamp(36px, 4vw, 80px); margin-top: 20px; }
.edu__item {
  width: clamp(250px, 24vw, 380px);
  padding-top: 22px;
  border-top: 2px solid var(--ink);
}
.edu__item--aside { width: clamp(170px, 14vw, 230px); border-top-color: var(--line); }
.edu__note { margin-top: 12px; font-size: 13.5px; color: var(--body-soft); text-align: justify; -webkit-hyphens: auto; hyphens: auto; }
.edu__note em { font-style: normal; color: var(--accent); font-weight: 600; }

/* ============ Contact ============ */

.panel--contact { background: var(--contrast-bg); color: var(--contrast-text); }
.panel--contact .ghost { -webkit-text-stroke-color: var(--contrast-line); }
.panel--contact .label { color: var(--contrast-muted); }
.panel--contact .label__line { background: var(--contrast-accent); }
.panel--contact .label__arrow { color: var(--contrast-accent); }
.panel--contact .display__line--accent { color: var(--contrast-accent); }


.contact-rows { max-width: 720px; margin-top: 30px; border-top: 1px solid var(--contrast-line); }
.contact-row {
  display: flex;
  align-items: baseline;
  gap: 24px;
  padding: 16px 0;
  border-bottom: 1px solid var(--contrast-line);
  font-size: clamp(15px, 1.4vw, 19px);
  transition: padding-left .4s var(--ease-out);
}
a.contact-row:hover { padding-left: 14px; }
a.contact-row:hover em { color: var(--contrast-accent); }
.contact-row em {
  font-style: normal;
  flex: 0 0 90px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .25em;
  text-transform: uppercase;
  color: var(--contrast-muted);
  transition: color .3s;
}
.contact-row .label__arrow { margin-left: auto; color: var(--contrast-accent); }

.contact-foot {
  display: inline-block;
  margin-top: 46px;
  font-size: 11px;
  letter-spacing: .25em;
  text-transform: uppercase;
  color: var(--contrast-muted);
  transition: color .3s;
}
a.contact-foot:hover { color: var(--contrast-accent); }

/* ============ Progress bar ============ */

.progress {
  position: fixed;
  left: 48px; right: 48px; bottom: 22px;
  height: 2px;
  background: var(--line);
  z-index: 50;
}
.progress__bar {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width .15s linear;
}

/* Header/progress over the contrast (contact) panel */
body.on-dark .site-nav a,
body.on-dark .logo__text { color: var(--contrast-text); }
body.on-dark .counter { color: var(--contrast-muted); }
body.on-dark .progress { background: var(--contrast-line); }
body.on-dark .progress__bar { background: var(--contrast-accent); }
body.on-dark .theme-toggle { color: var(--contrast-text); border-color: var(--contrast-line); }
body.on-dark .logo__sq--b { border-color: var(--contrast-text); background: var(--contrast-bg); }

/* ============================================================
   Vertical fallback — mobile & prefers-reduced-motion
   ============================================================ */

body.vertical { overflow-x: hidden; }
body.vertical .hscroll-viewport { position: static; overflow: visible; height: auto; }
body.vertical .track { display: block; transform: none !important; height: auto; }
body.vertical .panel {
  width: 100% !important;
  height: auto;
  min-height: 100svh;
  /* large bottom padding reserves a clear strip for the ghost word */
  padding: calc(var(--head-h) + 24px) 22px 150px;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
}
body.vertical .scroll-hint { display: none; }
body.vertical .panel__inner--split { grid-template-columns: 1fr; gap: 44px; }
body.vertical .panel--wide .panel__inner { flex-direction: column; align-items: flex-start; }
body.vertical .timeline { flex-direction: column; gap: 44px; padding-top: 0; padding-left: 26px; }
body.vertical .timeline__rail { top: 0; bottom: 0; left: 0; right: auto; width: 1px; height: auto; }
body.vertical .timeline__rail::after { display: none; }
body.vertical .job, body.vertical .job--featured { width: 100%; }
body.vertical .job__dot { top: 6px; left: -30px; }
body.vertical .cards { flex-wrap: wrap; }
body.vertical .card { width: 100%; max-width: 420px; }
/* on mobile the expandable card stays a single column and opens downward */
body.vertical .card--expandable { flex-direction: column; width: 100%; max-width: 420px; }
body.vertical .card--expandable .card__col { flex: 1 1 auto; }
body.vertical .card__more {
  width: auto;
  align-self: stretch;
  transition: max-height .5s var(--ease-out), opacity .4s ease;
}
body.vertical .card__more .card__block { width: auto; padding-right: 0; }
body.vertical .card--open .card__more {
  width: auto;
  max-height: 1600px;
  margin-left: 0;
  overflow-y: visible;
}
body.vertical .edu { flex-direction: column; }
body.vertical .edu__item { width: 100%; max-width: 460px; }
body.vertical .hero__portrait {
  position: relative;
  right: auto; top: auto;
  transform: none;
  margin-top: 50px;
  max-width: 100%;
}
body.vertical .panel--hero .panel__inner { max-width: 100%; }

/* ghost word: shrink so the longest word (EXPERIENCE) always fits the
   viewport, pin it into the reserved bottom strip and hard-clip it */
body.vertical .ghost {
  display: inline-block;
  font-size: clamp(40px, 12.5vw, 88px);
  left: 16px;
  bottom: 16px;
  max-width: calc(100vw - 32px);
  overflow: hidden;
}

body.vertical .site-nav { display: none; }
body.vertical .reveal { transform: translateY(40px); }
body.vertical .panel.in .reveal { transform: none; }

/* mobile header: solid bar that hides on scroll down, returns on scroll up */
body.vertical .site-head {
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  transition: transform .45s var(--ease-out), background-color .3s ease, border-color .3s ease;
}
body.vertical.on-dark .site-head {
  background: var(--contrast-bg);
  border-color: var(--contrast-line);
}
body.vertical.head-hidden .site-head { transform: translateY(-100%); }

/* contact rows: let long values wrap cleanly on narrow screens */
body.vertical .contact-row { flex-wrap: wrap; gap: 6px 16px; }
body.vertical .contact-row em { flex: 0 0 100%; }
body.vertical .contact-row span { word-break: break-word; min-width: 0; }
body.vertical .contact-rows { max-width: 100%; }

@media (max-width: 860px) {
  :root { --head-h: 64px; }
  .site-head { padding: 0 18px; }
  .progress { left: 18px; right: 18px; bottom: 14px; }
  .display { font-size: clamp(40px, 11vw, 72px); }
  .display--md { font-size: clamp(32px, 9vw, 56px); }
  .body-lg { max-width: 100%; }
  .quote { max-width: 100%; }
  .facts em { flex: 0 0 92px; }
  .logo__text { font-size: 11px; }
  .counter { letter-spacing: .18em; font-size: 11px; }
}

@media (max-width: 400px) {
  .job__title { font-size: 19px; }
}

/* ============================================================
   Archive page (archive.html) — simple vertical detail layout
   ============================================================ */

body.archive { overflow-x: hidden; }
body.archive .site-head {
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
body.archive .reveal { transform: translateY(40px); }
body.archive .logo__text { opacity: 1; transform: none; }

.archive-wrap {
  max-width: 1020px;
  margin: 0 auto;
  padding: calc(var(--head-h) + clamp(32px, 6vh, 70px)) clamp(20px, 5vw, 48px) 120px;
}
.archive-intro { margin-bottom: clamp(44px, 9vh, 100px); }

.arch {
  border-top: 1px solid var(--line);
  padding: clamp(32px, 6vh, 64px) 0;
}
.arch__gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
  gap: clamp(14px, 2vw, 24px);
  margin: 26px 0;
}
.arch__gallery .img-slot { aspect-ratio: 4 / 3; filter: none; }
.arch__txt {
  font-size: 15px;
  line-height: 1.65;
  color: var(--body-soft);
  max-width: 72ch;
  margin-bottom: 14px;
  text-align: justify;
  -webkit-hyphens: auto;
  hyphens: auto;
}
.arch .stack { margin-top: 20px; }
.arch .job__org { margin-bottom: 0; }

.archive-foot {
  border-top: 1px solid var(--line);
  padding-top: 34px;
}

/* keyboard accessibility */
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
