/* =========================================================
   Berat Zekaj — portfolio
   Timeless and quiet: one typeface, three colours from
   Sanzo Wada's combination no. 207 (Black, Glaucous Green,
   Sudan Brown), whitespace and 1px lines. Only the swing plays.
   ========================================================= */

/* ---------- Tokens ---------- */
:root {
  --bg: #EEF2F0;
  --surface: #DCE6E1;
  --text: #111314;          /* 16.5:1 on bg, 14.6:1 on surface */
  --text-muted: #4A5250;    /* 7.1:1 on bg, 6.3:1 on surface */
  --line: #C9D6D0;
  --accent: #A36752;        /* ±4:1 — large/bold text, underlines, hover, focus only */
  --accent-text: #8D5947;   /* same hue, a touch darker, for link text: 5.1:1 on bg */

  --font: Georgia, "Times New Roman", serif;   /* headings and the rest: system fonts only, nothing to download */
  /* Paragraphs: the device's own UI font — San Francisco on Apple devices, Segoe UI on
     Windows, Roboto on Android. (SF Pro can't be shipped as a web font: Apple's licence.) */
  --font-text: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --fs-label: 0.875rem;                                  /* 14px */
  --fs-body: 1.125rem;                                   /* 18px */
  --fs-lead: clamp(1.25rem, 1.15rem + 0.45vw, 1.5rem);
  --fs-h3: clamp(1.25rem, 1.17rem + 0.35vw, 1.4375rem);
  --fs-h2: clamp(2rem, 1.45rem + 2.4vw, 3.5rem);
  --fs-h1: clamp(2.75rem, 1.6rem + 5vw, 5.75rem);

  --pad: clamp(20px, 8vw, 128px);                            /* roomier side margins on desktop */
  --content: 1280px;                                         /* max width of the content column */
  --side: max(var(--pad), (100% - var(--content)) / 2);      /* side margin that centres it */
  --gutter: clamp(16px, 2vw, 32px);
  --section: clamp(96px, 13vw, 200px);
  --header-h: 72px;
  --row-gap: clamp(36px, 4.5vw, 64px);
  --measure: 65ch;
  --radius: 6px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  color-scheme: light;
}

/* Dark: follows the system unless the toggle chose light; the toggle can also force dark. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1F2020;
    --surface: #2A2C2C;
    --text: #DCE6E1;        /* 12.8:1 on bg, 11.0:1 on surface */
    --text-muted: #9FB3AB;  /* 7.4:1 on bg, 6.4:1 on surface */
    --line: #3A3C3C;
    --accent: #C98A72;      /* 5.7:1 on bg (4.9:1 on surface); bg on accent 5.7:1 */
    --accent-text: #C98A72; /* link text: already 5.7:1 */
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #1F2020;
  --surface: #2A2C2C;
  --text: #DCE6E1;        /* 12.8:1 on bg, 11.0:1 on surface */
  --text-muted: #9FB3AB;  /* 7.4:1 on bg, 6.4:1 on surface */
  --line: #3A3C3C;
  --accent: #C98A72;      /* 5.7:1 on bg (4.9:1 on surface); bg on accent 5.7:1 */
  --accent-text: #C98A72; /* link text: already 5.7:1 */
  color-scheme: dark;
}

/* ---------- Base ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  background: var(--bg);
  scroll-padding-top: calc(var(--header-h) + 16px);   /* anchors land below the fixed bar */
  scrollbar-gutter: stable;   /* the scrollbar's space stays reserved: locking scroll (open menu) never shifts the page */
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

h1, h2, h3, h4, p, ul, ol, dl, dd { margin: 0; padding: 0; }
h1, h2, h3, h4 { font-weight: 400; font-size: inherit; }
p,
.legal__body li { font-family: var(--font-text); }
/* …except where Georgia stays: the years and the footers */
.entry__year,
.footer-bar p,
.page-foot p { font-family: var(--font); }
ul, ol { list-style: none; }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
img { max-width: 100%; }
[hidden] { display: none !important; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
/* Sections that receive focus from the menu (tabindex="-1") aren't controls: no ring on them */
[tabindex="-1"]:focus { outline: none; }
::selection { background: var(--text); color: var(--bg); }

.skip-link {
  position: fixed;
  left: var(--side);
  top: 12px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--text);
  color: var(--bg);
  border-radius: var(--radius);
}
.skip-link:not(:focus-visible) {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* 12-column grid, left aligned */
.grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gutter);
  padding-inline: var(--side);
}
.grid > * { grid-column: 1 / -1; }

/* Shared link style: underline that warms to the accent */
.text-link,
.footer-bar a { display: inline-flex; align-items: center; gap: 0.3em; min-height: 44px; }
.text-link,
.footer-bar a,
.entry__title a {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
  text-decoration-color: var(--text-muted);
  transition: color 0.25s var(--ease), text-decoration-color 0.25s var(--ease), text-decoration-thickness 0.25s var(--ease), text-underline-offset 0.25s var(--ease);
}
.text-link:hover,
.footer-bar a:hover,
.entry__title a:hover,
.text-link:focus-visible,
.footer-bar a:focus-visible,
.entry__title a:focus-visible { text-decoration-color: currentColor; text-decoration-thickness: 3px; text-underline-offset: 0.3em; }

/* ---------- Links: the whole link turns accent ----------
   Mouse: on hover. Keyboard: on focus. Touch: while tapped (no sticky hover on phones).
   Light mode uses --accent-text, a slightly darker tint of the accent, so link text keeps 4.5:1. */
:is(.logo, .site-nav a, .mobile-menu nav a, .text-link, .footer-bar a, .entry__title a, .legal__body a, .page-foot a):is(:focus-visible, :active) { color: var(--accent-text); }
@media (hover: hover) and (pointer: fine) {
  :is(.logo, .site-nav a, .mobile-menu nav a, .text-link, .footer-bar a, .entry__title a, .legal__body a, .page-foot a):hover { color: var(--accent-text); }
}

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 32px;
  height: var(--header-h);
  padding: 0 var(--side);
  background: var(--bg);
  transition: box-shadow 0.3s var(--ease);
}
.site-header.is-scrolled { box-shadow: 0 1px 0 var(--line); }

.logo {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 1.25rem;
  letter-spacing: 0.01em;
  text-decoration: none;
  transition: color 0.25s var(--ease);
}

.clock {
  font-size: var(--fs-label);
  margin-left: clamp(20px, 2.5vw, 36px);
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.no-js .clock { display: none; }
.site-header > .theme-toggle { margin: 0 auto 0 4px; }
.site-nav { margin-left: auto; }

/* Theme toggle: moon in light mode, sun in dark; the icons turn as they swap */
.theme-toggle {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  color: var(--text);
  background: linear-gradient(var(--accent), var(--accent)) center calc(100% - 6px) / 0 2px no-repeat;
  transition: background-size 0.3s var(--ease), background-color 0.15s linear;
}
.theme-toggle svg {
  grid-area: 1 / 1;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: rotate 0.3s var(--ease), opacity 0.3s var(--ease), scale 0.3s var(--ease);
}
.theme-toggle__sun { opacity: 0; rotate: -90deg; scale: 0.6; }
[data-color-mode="dark"] .theme-toggle__sun { opacity: 1; rotate: 0deg; scale: 1; }
[data-color-mode="dark"] .theme-toggle__moon { opacity: 0; rotate: 90deg; scale: 0.6; }
.theme-toggle:focus-visible { background-size: 20px 2px; }
.theme-toggle:active { background-color: var(--surface); }
@media (hover: hover) and (pointer: fine) {
  .theme-toggle:hover { background-size: 20px 2px; }
}
/* Colours glide over when switching (only during the switch, so page load stays instant) */
@media (prefers-reduced-motion: no-preference) {
  .theme-switching,
  .theme-switching * { transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease !important; }
  .theme-switching .theme-toggle svg { transition: rotate 0.3s var(--ease), opacity 0.3s var(--ease), scale 0.3s var(--ease) !important; }
}

.site-nav ul { display: flex; gap: clamp(20px, 2.5vw, 40px); }
.site-nav a,
.menu-toggle {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 1rem;
  text-decoration: none;
  padding: 6px 0;
  background: linear-gradient(var(--accent), var(--accent)) left bottom / 0 2px no-repeat;
  transition: background-size 0.3s var(--ease), color 0.25s var(--ease);
}
.site-nav a,
.menu-toggle { background-position: left calc(100% - 8px); }
.site-nav a:focus-visible,
.site-nav a[aria-current="true"],
.menu-toggle:focus-visible { background-size: 100% 2px; }
@media (hover: hover) and (pointer: fine) {
  .site-nav a:hover,
  .menu-toggle:hover { background-size: 100% 2px; }
  .site-nav a[aria-current="true"]:hover { background-color: transparent; }
}

.menu-toggle { display: none; gap: 12px; padding-left: 12px; margin-left: auto; background-image: none; }
.menu-toggle__label {
  display: grid;
  height: 1.3em;
  overflow: hidden;                      /* a window of one line: the words slide through it */
  line-height: 1.3;
}
.menu-toggle__label span { transition: translate 0.35s var(--ease); }
.menu-toggle[aria-expanded="true"] .menu-toggle__label span { translate: 0 -100%; }
.burger { position: relative; width: 22px; height: 14px; }
.burger span {
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  border-radius: 1px;
  background: currentColor;
  transition: translate 0.35s var(--ease), rotate 0.35s var(--ease), opacity 0.2s linear;
}
.burger span:nth-child(1) { top: 0; }
.burger span:nth-child(2) { top: 6px; }
.burger span:nth-child(3) { top: 12px; }
.menu-toggle[aria-expanded="true"] .burger span:nth-child(1),
.burger.is-x span:nth-child(1) { translate: 0 6px; rotate: 45deg; }
.menu-toggle[aria-expanded="true"] .burger span:nth-child(2),
.burger.is-x span:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] .burger span:nth-child(3),
.burger.is-x span:nth-child(3) { translate: 0 -6px; rotate: -45deg; }

@media (hover: hover) and (pointer: fine) {
  .menu-toggle:hover .menu-toggle__label { text-decoration: underline 2px var(--accent); text-underline-offset: 0.2em; }
}
.menu-toggle:focus-visible .menu-toggle__label { text-decoration: underline 2px var(--accent); text-underline-offset: 0.2em; }

.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: -1;                           /* inside the header: above its background, under the logo and Menu button */
  display: none;                         /* JS: shown when not [hidden]; no JS: shown via :target */
  flex-direction: column;
  justify-content: space-between;
  padding: calc(var(--header-h) + 32px) var(--side) 32px;
  background: var(--bg);
  border-top: 1px solid var(--line);
  overscroll-behavior: contain;
}
.js .mobile-menu:not([hidden]),
.no-js .mobile-menu:target { display: flex; }
.menu-open { overflow: hidden; }   /* on <html>, so scrollbar-gutter keeps the scrollbar space: nothing shifts */
/* Without JS: plain "Menu"/"Close" links instead of the button */
.menu-link,
.js .menu-link { display: none !important; }
@media (max-width: 960px) {
  .no-js .menu-link--open { display: inline-flex !important; }
  .no-js:has(.mobile-menu:target) .menu-link--open { display: none !important; }
  .no-js:has(.mobile-menu:target) .menu-link--close { display: inline-flex !important; }
  .no-js:has(.mobile-menu:target) { overflow: hidden; }          /* page behind doesn't scroll */
  .no-js:has(.mobile-menu:target) .swing { display: none; }
  .no-js .mobile-menu__close,
  .no-js .mobile-menu .theme-toggle { display: none; }           /* need JS; "Close" sits in the bar */
}
.mobile-menu ul { display: grid; }
.mobile-menu nav a {
  display: block;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  min-height: 44px;
  font-size: 2rem;
  line-height: 1.2;
  text-decoration: none;
  transition: background-color 0.15s linear, color 0.25s var(--ease);
}
@media (hover: hover) and (pointer: fine) {
  .mobile-menu nav a:hover { text-decoration: underline 1px var(--accent); text-underline-offset: 0.2em; }
}
/* Touch has no hover: a tap shows a light surface; keyboard focus and the current section get the underline */
.mobile-menu nav a:active,
.menu-toggle:active { background-color: var(--surface); }
.mobile-menu nav a[aria-current="true"],
.mobile-menu nav a:focus-visible { text-decoration: underline 1px var(--accent); text-underline-offset: 0.2em; }
.mobile-menu__foot { display: flex; align-items: center; gap: 8px; padding-top: 24px; }
.mobile-menu__foot .clock { margin-left: 0; }
.mobile-menu__close {
  display: inline-flex;
  font: inherit;
  color: inherit;
  margin-left: auto;                     /* stays bottom-right, also when the clock is absent (no JS) */
  align-items: center;
  gap: 8px;
  min-width: 44px;
  min-height: 44px;
  padding: 0 4px;
  font-size: 1rem;
  text-decoration: none;
  border-radius: var(--radius);
}
.mobile-menu__close svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.mobile-menu__close:active { background-color: var(--surface); }
.mobile-menu__close:focus-visible { text-decoration: underline 2px var(--accent); text-underline-offset: 0.2em; }
@media (hover: hover) and (pointer: fine) {
  .mobile-menu__close:hover { text-decoration: underline 2px var(--accent); text-underline-offset: 0.2em; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;                    /* the swing hangs from the top of the hero = top of the page */
  overflow-x: clip;                      /* the empty right side of the image may run off-screen */
  align-content: center;
  min-height: min(88svh, 920px);         /* a little less than a full screen: About's line peeks in, its title doesn't yet */
  padding-top: calc(var(--header-h) + 24px);
  padding-bottom: 0;                     /* the space below the hero comes from About's margin only */
}
.hero__head { grid-column: 1 / span 7; grid-row: 1; align-self: end; position: relative; z-index: 1; }
.greeting { min-height: 1lh; margin-bottom: 16px; font-size: 1rem; color: var(--text-muted); }
.no-js .greeting { display: none; }
.hero__title {
  font-size: clamp(2.25rem, 1.4rem + 3.6vw, 4.5rem);
  line-height: 1.08;
  letter-spacing: -0.015em;
}
.line { display: block; }
.swing {
  position: absolute;
  grid-area: auto;                       /* not a grid item: positioned against the whole hero, not the column */
  top: 0;
  right: var(--side);                    /* lines up with the right edge of the content */
  z-index: 55;                           /* the ropes run over the fixed nav (z-index 50)… */
  width: clamp(260px, 36vw, 460px);
  height: auto;
  pointer-events: none;                  /* …which stays clickable */
}
 @media (min-width: 961px) {
  /* Desktop: keep both ropes out of the nav text. The right rope (at ~36% of the image
     width) lands just left of the nav. --nav-w ≈ the nav's width; if a nav item is added
     (e.g. Work), raise it. */
  .swing {
    --w: clamp(260px, 36vw, 460px);
    --nav-w: calc(242px + 3 * clamp(20px, 2.5vw, 40px));
    width: var(--w);
    right: auto;
    left: calc(100% - var(--side) - var(--nav-w) - 44px - var(--w) * 0.36);
  }
}
.menu-open .swing { display: none; }   /* never swing over the open menu */
.hero__foot { grid-column: 1 / span 7; grid-row: 2; margin-top: 28px; }
.hero__lede {
  max-width: 34ch;
  font-size: var(--fs-lead);
  line-height: 1.5;
  color: var(--text-muted);
}
/* "Open for work" with a softly pulsing dot */
.status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 28px;
  font-size: 1rem;
  color: var(--text-muted);
}
.status__dot {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}
@media (prefers-reduced-motion: no-preference) {
  .status__dot::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: var(--accent);
    animation: status-pulse 2.4s ease-out infinite;
  }
  @keyframes status-pulse { from { opacity: 0.6; scale: 1; } to { opacity: 0; scale: 2.8; } }
}
.hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 32px;
  margin-top: 36px;
}


/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45em;
  min-height: 52px;
  padding: 0 26px;
  border-radius: var(--radius);
  font-size: 1.1875rem;   /* 19px bold = large text, so the 4:1 accent passes */
  font-weight: 700;
  text-decoration: none;
  transition: background-color 0.25s var(--ease), color 0.25s var(--ease), border-color 0.25s var(--ease);
}
.btn--primary { background: var(--text); color: var(--bg); }
.btn--primary:hover,
.btn--primary:active { background: var(--accent); }
.btn--accent { background: var(--accent); color: var(--bg); min-height: 60px; padding: 0 34px; font-size: 1.375rem; }
.btn--accent:hover { background: var(--text); }
.btn--outline { border: 1px solid var(--text); color: var(--text); }
.btn--outline:hover,
.btn--outline:active { border-color: var(--accent); box-shadow: inset 0 0 0 2px var(--accent); }

/* ---------- 404 avatar ----------
   Plain <img>; the SVG has its own white fill under the lines, so it reads on light and dark. */
.avatar-frame {
  display: block;
  width: 100%;
  background: none;
  aspect-ratio: 1 / 1;                   /* the drawing brings its own white fill: no card behind it */
}
.avatar-frame img { display: block; width: 100%; height: 100%; }

/* ---------- Sections ---------- */
.section {
  row-gap: var(--row-gap);
  padding-inline: 0;
  margin-inline: var(--side);          /* the dividing line lines up with the content */
  margin-top: var(--section);
}
.section > .rule { margin-bottom: calc(var(--row-gap) * -0.4); }
.hero + .section { margin-top: clamp(72px, 8vw, 120px); }  /* tighter step from the hero into About */

/* Thin dividing line (an element, so it can draw itself) */
.rule { grid-column: 1 / -1; height: 1px; background: var(--line); }
.section-title {
  grid-column: 1 / span 9;
  font-size: var(--fs-h2);
  line-height: 1.15;
  letter-spacing: -0.01em;
  max-width: 18em;
  text-wrap: balance;
}

.prose {
  grid-column: 1 / span 8;
  display: grid;
  gap: 1.1em;
  max-width: var(--measure);
  font-size: var(--fs-lead);
  line-height: 1.6;
}
.prose p:first-child { color: var(--text); }
.prose p + p { color: var(--text-muted); }

/* About: the three roles as a quiet list */
.row {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gutter);
  padding-bottom: 22px;
}
.row > .rule { margin-bottom: 22px; }
.row__title { grid-column: 1 / span 4; font-size: var(--fs-h3); line-height: 1.3; }
.row__body { grid-column: 5 / -1; color: var(--text-muted); max-width: var(--measure); }

/* Three columns (Philosophy, Services, Work) */
.columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(32px, 4vw, 64px) var(--gutter);
}
.column > .rule { margin-bottom: 20px; }
.column__title { font-size: var(--fs-h3); line-height: 1.3; margin-bottom: 12px; }
.column p { color: var(--text-muted); }

/* Services: a thin accent underline grows under the heading on hover */
.service .column__title {
  display: inline;
  background: linear-gradient(var(--accent), var(--accent)) left bottom / 0 3px no-repeat;
  padding-bottom: 4px;
  transition: background-size 0.4s var(--ease);
}
.service .column__title::after { content: ""; display: block; margin-bottom: 12px; }
.service:hover .column__title { background-size: 100% 3px; }

.tags {
  display: flex;
  flex-wrap: wrap;
  margin-top: 20px;
  font-size: var(--fs-label);
  color: var(--text-muted);
  letter-spacing: 0.02em;
}
.tags li:not(:last-child)::after { content: "·"; margin: 0 0.6em; }

/* Selected work */
.case__img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius);
  margin-bottom: 20px;
  background: var(--surface);
}
.case__facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; }
.case__facts dt { font-size: var(--fs-label); color: var(--text-muted); padding-top: 3px; }
.case__facts dd { color: var(--text-muted); }

/* ---------- Experience ---------- */
.group-title {
  font-size: var(--fs-label);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: calc(var(--row-gap) * -0.6);
}
.entry {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gutter);
  padding-bottom: 26px;
}
.entry > .rule { margin-bottom: 26px; }
.entry__year {
  grid-column: 1 / span 3;
  color: var(--text-muted);
  font-variant-numeric: oldstyle-nums tabular-nums;
  white-space: nowrap;
}
.entry__body { grid-column: 4 / -1; max-width: var(--measure); }
.entry__title { font-size: var(--fs-h3); line-height: 1.3; }
.entry__org { margin: 8px 0 16px; font-size: 1rem; font-style: italic; color: var(--text-muted); }   /* breathing room: title · where · what */
.entry__body > p:last-child { color: var(--text-muted); }

/* ---------- Skills ---------- */
.skill-list {
  grid-column: 1 / span 10;
  display: flex;
  flex-wrap: wrap;
  row-gap: 6px;
  font-size: var(--fs-lead);
  line-height: 1.5;
  color: var(--text-muted);
}
.skill-list li:not(:last-child)::after { content: "·"; margin: 0 0.5em; }

/* ---------- Contact: the one calm surface ---------- */
.site-footer { margin-top: var(--section); }
.contact {
  row-gap: clamp(32px, 4vw, 56px);
  padding-block: clamp(64px, 9vw, 140px);
  background: var(--surface);
}
.contact__title {
  font-size: clamp(3rem, 1.6rem + 6vw, 7rem);
  line-height: 1;
  letter-spacing: -0.02em;
}
.contact__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 20px; }
.email-group { position: relative; display: inline-flex; align-items: center; gap: 10px; }

.copy-btn {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  transition: border-color 0.25s var(--ease);
}
.copy-btn:hover { border-color: var(--accent); }
.copy-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linejoin: round; }
.copy-status {
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  font-size: var(--fs-label);
  color: var(--text);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.2s linear;
}
.copy-status.is-visible { opacity: 1; }

.footer-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 24px;
  padding: 28px var(--side) 32px;
  font-size: 1rem;
  color: var(--text-muted);
}
.footer-bar a { color: var(--text); }
.footer-bar__top { margin-left: auto; }   /* right: the thumb side */

/* ---------- Motion ----------
   All animation runs in GSAP (main.js), which only ever sets start states from JS.
   The one exception is the reading-progress bar: pure CSS, where supported. */
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: scroll()) {
    .progress { position: fixed; inset: 0 0 auto; z-index: 60; height: 2px; background: var(--accent); transform-origin: left; animation: progress linear both; animation-timeline: scroll(root); }
    @keyframes progress { from { scale: 0 1; } }
  }
}
/* Once you scroll, the swing slips under the bar instead of covering the nav links (class set by ScrollTrigger). */
.swing.is-under { z-index: 40; }

/* ---------- Simple pages (404, privacy) ----------
   Same frame as the home page: side margins (--side), bar height and title size match. */
.notfound,
.legal {
  min-height: 100svh;
  display: grid;
  grid-template-rows: var(--header-h) 1fr auto;
  gap: 48px;
  padding: 0 var(--side) 32px;
}
.page-bar { display: flex; align-items: center; justify-content: space-between; }
.page-bar .theme-toggle { margin-right: -10px; }
.notfound__body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 380px); gap: 48px; align-items: center; }
.notfound__title { font-size: clamp(2.25rem, 1.4rem + 3.6vw, 4.5rem); line-height: 1.08; letter-spacing: -0.015em; margin-top: 12px; }
.notfound__actions { margin-top: 36px; }
.notfound p { color: var(--text-muted); }
.legal__body { max-width: var(--measure); padding-top: 24px; }
.legal__title { font-size: var(--fs-h2); line-height: 1.15; letter-spacing: -0.01em; }
.legal__updated { margin-top: 12px; font-size: 1rem; color: var(--text-muted); }
.legal__body h2 { margin-top: 48px; font-size: var(--fs-h3); line-height: 1.3; }
.legal__body p,
.legal__body ul { margin-top: 12px; color: var(--text-muted); }
.legal__body ul { padding-left: 1.2em; list-style: disc; }
.legal__body li + li { margin-top: 6px; }
.legal__body strong { color: var(--text); font-weight: 400; }
.page-foot .footer-bar__copy { margin: 0; }
@media (max-width: 760px) { .page-foot .footer-bar__copy { flex-basis: 100%; } }
.page-foot a { display: inline-flex; align-items: center; min-height: 44px; }
.legal__body a,
.page-foot a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.22em; text-decoration-color: var(--text-muted); color: var(--text); }
.legal__body a:hover,
.page-foot a:hover,
.legal__body a:focus-visible,
.page-foot a:focus-visible { text-decoration-color: currentColor; text-decoration-thickness: 3px; }
.page-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; padding-top: 24px; border-top: 1px solid var(--line); font-size: 1rem; color: var(--text-muted); }
@media (max-width: 760px) {
  .notfound__body { grid-template-columns: minmax(0, 1fr); }
  .notfound .avatar-frame { grid-row: 1; width: min(72%, 280px); }
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  /* Small screens: the menu button takes over (JS). Without JS there's no menu at all:
     it's one page, everything is reached by scrolling, and the skip link still works. */
  .site-nav,
  .site-header > .clock,
  .site-header > .theme-toggle { display: none; }   /* only the ones in the bar: the open menu has its own */
  .menu-toggle { display: inline-flex; }
  .columns { grid-template-columns: minmax(0, 1fr); max-width: var(--measure); }
}

@media (max-width: 760px) {
  .hero { min-height: 0; padding-top: calc(var(--header-h) + 16px); }
  .hero__actions { gap: 4px 28px; }
  .section-title,
  .prose,
  .skill-list { grid-column: 1 / -1; }
  .row__title,
  .row__body,
  .entry__year,
  .entry__body { grid-column: 1 / -1; }
  .row__title { margin-bottom: 4px; }
  .entry__year { margin-bottom: 6px; }
  .contact__actions { flex-direction: column; align-items: stretch; }
  .email-group .btn { flex: 1; }
  .footer-bar__copy { flex-basis: 100%; }    /* copyright on its own line; Privacy left, Back to top right below it */
}

/* Phones and small tablets: the swing hangs above the title, on the right like on
   desktop, with its ropes between the logo and the Menu button. */
@media (max-width: 760px) {
  .swing { width: min(70vw, 340px); right: 0; }
  .hero__head,
  .hero__foot { grid-column: 1 / -1; }
  .hero { padding-top: calc(min(70vw, 340px) * 1680 / 1420 * 0.94 + 24px); }   /* drawing height + a little air */
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ---------- Editorial / Gradient / Swing: which version you're on ---------- */
.version { font-size: var(--fs-label); white-space: nowrap; color: var(--text-muted); }
.version__on { color: var(--text); }
.version a { color: var(--text-muted); text-underline-offset: 0.2em; display: inline-flex; align-items: center; min-height: 44px; }
.version a:hover, .version a:focus-visible { color: var(--text); }
@media (max-width: 960px) { .site-header > .version { margin-left: auto; } }

/* The same "Zekaj®" mark as the editorial version, for consistency across the three versions */
.logo--mark { font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-weight: 700; font-size: 1.375rem; letter-spacing: -0.04em; }
.logo--mark sup { font-size: 0.45em; font-weight: 500; margin-left: 1px; vertical-align: 1.1em; }
