/* ============================================================
   Lampros Konstantellos — personal site
   Refined version: balanced hero, justified news, minimal icons,
   smooth transitions, refined typography.
   ============================================================ */

:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --ink: #0a1f44;
  --ink-soft: #1f2d4a;
  --muted: #5a6680;
  /* #646e88: WCAG AA for small meta text — 4.70:1 on --bg / 5.09:1 on --surface
     (was #6c7790 at 4.15 / 4.49, below the 4.5:1 threshold for normal text). */
  --muted-2: #646e88;
  --line: #e3e7ee;
  --line-soft: #eef1f6;
  --accent: #1f3a8a;
  --accent-hover: #142a6b;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --shadow-sm: 0 1px 2px rgba(10, 31, 68, 0.04);
  --shadow-md: 0 8px 24px rgba(10, 31, 68, 0.06);
  --shadow-lg: 0 24px 60px rgba(10, 31, 68, 0.10);
  --container: 1100px;
  --transition: 220ms cubic-bezier(.2,.7,.2,1);
}

* { box-sizing: border-box; }
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}
.skip-link {
  position: absolute;
  top: -40px;
  left: 8px;
  z-index: 100;
  padding: 8px 14px;
  background: var(--ink);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: top 160ms ease;
}
.skip-link:focus,
.skip-link:focus-visible {
  top: 8px;
  color: #fff;
  outline: 2px solid #fff;
  outline-offset: 2px;
}
html, body { margin: 0; padding: 0; }
body {
  font-family: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-hover); }
img { max-width: 100%; display: block; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }

/* ===== Header ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(244, 246, 249, 0.85);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 18px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  cursor: pointer;
}
.brand-name {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.brand-role {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 2px;
}
.nav { display: flex; gap: 28px; }
.nav a {
  font-size: 14px;
  color: var(--muted);
  padding: 6px 0;
  position: relative;
  transition: color var(--transition);
}
.nav a:hover { color: var(--ink); }
.nav a.active { color: var(--ink); font-weight: 500; }
.nav a.active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
}

/* ===== Layout shell ===== */
main {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 28px 24px;
}
/* #main-content receives focus on client-side route changes (and via the skip
   link) so screen-reader/keyboard users land in the new content. It is a focus
   *target*, not a control, so no focus ring is drawn. */
#main-content:focus { outline: none; }
.page {
  animation: fade-up 360ms cubic-bezier(.2,.7,.2,1);
}
@keyframes fade-up {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 600ms cubic-bezier(.2,.7,.2,1),
              transform 600ms cubic-bezier(.2,.7,.2,1),
              border-color 200ms ease,
              box-shadow 200ms ease;
}
.reveal.in { opacity: 1; transform: translateY(0); }

/* ===== Hero ===== */
.hero-photo {
  transition: transform 500ms cubic-bezier(.2,.7,.2,1), box-shadow 500ms ease;
}
.hero-photo:hover {
  transform: translateY(-4px);
  box-shadow: 0 32px 80px rgba(10, 31, 68, 0.14);
}
.hero {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 64px;
  align-items: center;
  padding: 72px 0 64px;
}
.hero-text h1 {
  font-size: clamp(36px, 4.6vw, 56px);
  line-height: 1.08;
  letter-spacing: -0.025em;
  font-weight: 700;
  margin: 0 0 24px;
  color: var(--ink);
  text-wrap: balance;
}
.hero-text h1 em {
  font-style: normal;
  color: var(--accent);
}
.hero-text p {
  font-size: 16px;
  color: var(--muted);
  max-width: 460px;
  margin: 0 0 32px;
  line-height: 1.65;
}
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  transition: all var(--transition);
  border: 1px solid transparent;
}
/* The CTAs are <a> elements, and the global a:hover outranks a lone class,
   so each :hover re-declares its text color — without this the .btn-primary
   label turns --accent-hover on an --accent-hover background and vanishes. */
.btn-primary { background: var(--ink); color: white; }
.btn-primary:hover { background: var(--accent-hover); color: white; transform: translateY(-1px); }
.btn-ghost { border-color: var(--line); color: var(--ink); background: var(--surface); }
.btn-ghost:hover { border-color: var(--ink); color: var(--ink); transform: translateY(-1px); }
.btn .arrow { transition: transform var(--transition); }
.btn:hover .arrow { transform: translate(3px, -3px); }

.hero-photo {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;
  max-width: 360px;
  justify-self: end;
  margin-left: auto;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  background: #d9dde6;
}
.hero-photo img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center 15%;
}

/* ===== Section ===== */
section.block {
  padding: 56px 0;
  border-top: 1px solid var(--line);
}
section.block:first-of-type { border-top: none; }
.section-label {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin: 0 0 28px;
}
.section-label h2 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--ink);
}
.section-label .count {
  font-size: 12px;
  color: var(--muted-2);
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
}
.section-label-action { margin-left: auto; }
.view-all {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: color var(--transition), gap var(--transition);
}
.view-all:hover { gap: 9px; color: var(--accent-hover); }
.view-all svg { transition: transform var(--transition); }
.view-all:hover svg { transform: translateX(2px); }

/* ===== About ===== */
.about-shell {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 56px;
  align-items: start;
}
.about-side {
  position: sticky;
  top: 96px;
}
.about-side-label {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin-bottom: 14px;
}
.chip-list { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-soft);
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 5px 11px;
  border-radius: 999px;
  opacity: 0;
  transform: translateY(4px);
  animation: chip-in 480ms cubic-bezier(.2,.7,.2,1) forwards;
  transition: all var(--transition);
  cursor: default;
}
.chip:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}
@keyframes chip-in {
  to { opacity: 1; transform: translateY(0); }
}

.about-stream {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 4px 0 4px 22px;
}
/* A short navy accent tick at the top of the bio (pull-quote marker) replaces
   the old full-height grey rail — minimal, but keeps the brand navy note. It
   still scales in on reveal via .about-stream.in::before. */
.about-stream::before {
  content: "";
  position: absolute;
  left: 0;
  top: 4px;
  width: 3px;
  height: 40px;
  background: var(--accent);
  border-radius: 2px;
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 700ms cubic-bezier(.2,.7,.2,1) 120ms;
}
.about-stream.in::before { transform: scaleY(1); }
.about-paragraph {
  margin: 0;
  color: var(--ink-soft);
  font-size: 15.5px;
  line-height: 1.75;
  hyphens: auto;
  -webkit-hyphens: auto;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 700ms cubic-bezier(.2,.7,.2,1),
              transform 700ms cubic-bezier(.2,.7,.2,1);
}
@media (min-width: 720px) {
  .about-paragraph { text-align: justify; }
}
.about-paragraph.about-lead {
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  font-weight: 450;
  letter-spacing: -0.005em;
}
.about-stream.in .about-paragraph {
  opacity: 1;
  transform: translateY(0);
}
/* Quiet navy emphasis on the credibility phrases (institutions + award),
   wrapped in **bold** in data.js and parsed by renderInline. */
.about-paragraph strong { color: var(--ink); font-weight: 600; }

@media (max-width: 820px) {
  .about-shell { grid-template-columns: 1fr; gap: 24px; }
  .about-side { position: static; }
  .about-stream {
    gap: 20px;
    padding-left: 18px;
  }
  .about-paragraph {
    font-size: 15px;
    line-height: 1.7;
  }
  .about-paragraph.about-lead {
    font-size: 16px;
    line-height: 1.6;
  }
}

/* ===== Publications ===== */
.pub-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
@media (min-width: 720px) {
  .pub-list { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 719px) {
  .pub-list { grid-auto-rows: 1fr; }
  .pub-card { min-height: 260px; }
}
.pub-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 24px 26px 22px 28px;
  transition: all var(--transition);
  overflow: hidden;
  cursor: default;
  display: flex;
  flex-direction: column;
  height: 100%;
}
.pub-card .pub-body { flex: 1; display: flex; flex-direction: column; }
.pub-card .pub-links { margin-top: auto; }
.pub-card::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--accent);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 360ms cubic-bezier(.2,.7,.2,1);
}
.pub-card:hover::before { transform: scaleY(1); }
.pub-card:hover {
  border-color: #cdd5e3;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.pub-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  font-size: 11.5px;
  color: var(--muted-2);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 10px;
  font-feature-settings: "tnum";
}
.pub-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--muted-2); }
.pub-award {
  position: absolute;
  top: 16px;
  right: 16px;
  display: inline-flex;
  align-items: center;
  font-family: "Inter", sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.005em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  background: var(--surface);
  /* #7a5618: WCAG AA — ~6.6:1 on the white --surface badge. A quiet outline
     pill (no fill, no icon) reads as a minimal credential rather than a tag. */
  color: #7a5618;
  border: 1px solid #dcc488;
  padding: 5px 12px;
  border-radius: 999px;
  z-index: 1;
}
/* Keep the meta line clear of the absolute badge: it wraps before the badge
   edge at any card width (badge ≈141px wide + 16px right offset). */
.pub-award + .pub-meta {
  padding-right: 110px;
}
@media (max-width: 600px) {
  .pub-award {
    position: static;
    align-self: flex-start;
    margin-bottom: 10px;
  }
  .pub-award + .pub-meta {
    padding-right: 0;
  }
}
.pub-card h3 {
  font-size: 16.5px;
  font-weight: 600;
  line-height: 1.42;
  color: var(--ink);
  margin: 0 0 8px;
  text-wrap: balance;
}
.pub-authors {
  font-size: 13.5px;
  color: var(--muted);
  margin: 0 0 12px;
}
/* The author's own name is wrapped in **bold** in data.js and parsed by
   renderInline; lift only that token to full navy so authorship reads at a
   glance while co-authors stay in --muted. #0a1f44 on --surface ≈ 16.3:1 (AA). */
.pub-authors strong { color: var(--ink); font-weight: 600; }
.pub-description {
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.55;
  margin: 0 0 16px;
}
.pub-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.pub-links a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  font-weight: 500;
  padding: 6px 10px 6px 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  transition: all var(--transition);
}
.pub-links a:hover {
  border-color: var(--accent);
  background: rgba(31, 58, 138, 0.04);
}
.pub-links a svg { transition: transform var(--transition); }
.pub-links a:hover svg { transform: translate(2px, -2px); }

/* ===== News ===== */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}
.news-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
}
.news-card:hover {
  border-color: #cdd5e3;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.news-card .cover {
  aspect-ratio: 16 / 10;
  background: linear-gradient(135deg, #e9eef7 0%, #dde4f0 100%);
  position: relative;
  overflow: hidden;
}
.news-card .cover .ph {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted-2);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.06em;
  background-image:
    linear-gradient(135deg, transparent 0 49%, rgba(31,58,138,0.05) 49% 51%, transparent 51% 100%);
  background-size: 14px 14px;
}
.news-card .cover img { width: 100%; height: 100%; object-fit: cover; transition: transform 600ms cubic-bezier(.2,.7,.2,1); }
.news-card:hover .cover img { transform: scale(1.04); }
.news-card .body { padding: 18px 20px 20px; flex: 1; display: flex; flex-direction: column; }
.news-card .meta {
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin-bottom: 8px;
}
.news-card h3 {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--ink);
  margin: 0 0 8px;
  text-wrap: balance;
}
.news-card p {
  font-size: 13.5px;
  color: var(--muted);
  margin: 0;
  line-height: 1.55;
  flex: 1;
}
.news-card .read {
  margin-top: 14px;
  font-size: 13px;
  color: var(--accent);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* ===== List pages (/news, /publications) ===== */
.list-page {
  padding: 24px 0 0;
}
.list-header {
  margin: 0 0 32px;
}
.list-header h1 {
  font-size: clamp(28px, 3.2vw, 36px);
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 700;
  margin: 0 0 8px;
  color: var(--ink);
  text-wrap: balance;
}
.list-header p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  max-width: 560px;
}
.list-empty {
  color: var(--muted);
  font-size: 14.5px;
}

/* ===== Article ===== */
.article {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 0 0;
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--accent);
  margin-bottom: 32px;
  transition: gap var(--transition);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}
.back-link:hover { gap: 10px; }
.article-meta {
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin-bottom: 14px;
}
.article h1 {
  font-size: clamp(28px, 3.5vw, 40px);
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 700;
  margin: 0 0 32px;
  color: var(--ink);
  text-wrap: balance;
}
.article-cover {
  margin: 0 0 36px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: #d9dde6;
}
.article-cover img {
  width: 100%; height: 100%;
  object-fit: cover;
}
/* Anchor the crop to the top when a wide frame would otherwise cut a face off
   the top of the photo. Opt-in per article via coverAlign: "top". */
.news-card .cover.cover-align-top img,
.article-cover.cover-align-top img { object-position: top center; }

/* The frame hugs the video's own dimensions and centres it, so a portrait
   clip is not stretched into a wide box that pillarboxes it with black bars.
   width:auto + max-height lets the intrinsic aspect ratio drive the size. */
.article-video {
  margin: 0 auto 36px;
  width: fit-content;
  max-width: 100%;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #000;
  line-height: 0;
}
.article-video video {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 80vh;
}

.article-body {
  font-size: 16px;
  line-height: 1.75;
  color: var(--ink-soft);
  hyphens: auto;
  -webkit-hyphens: auto;
}
@media (min-width: 720px) {
  .article-body {
    text-align: justify;
    text-justify: inter-word;
  }
}
.article-body p { margin: 0 0 22px; }
.article-body strong { color: var(--ink); font-weight: 600; }

.article-gallery {
  margin: 40px 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.article-gallery .photo {
  aspect-ratio: 4/3;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: linear-gradient(135deg, #e9eef7 0%, #dde4f0 100%);
  position: relative;
  cursor: pointer;
  transition: transform var(--transition);
}
.article-gallery .photo:hover { transform: scale(1.01); }
.article-gallery .photo img { width: 100%; height: 100%; object-fit: cover; }
.article-gallery .photo.photo-align-top img { object-position: top center; }
.article-gallery .photo .ph {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted-2);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
  background-image:
    linear-gradient(135deg, transparent 0 49%, rgba(31,58,138,0.05) 49% 51%, transparent 51% 100%);
  background-size: 14px 14px;
}

/* Lightbox / image zoom */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(10, 31, 68, 0.86);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  cursor: default;
  animation: lightbox-in 180ms ease-out;
}
@keyframes lightbox-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.lightbox-img {
  max-width: min(100%, 1100px);
  max-height: 100%;
  width: auto;
  height: auto;
  border-radius: var(--radius-md);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.4);
  cursor: default;
  object-fit: contain;
}
.lightbox-close {
  position: absolute;
  top: 20px;
  right: 24px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  line-height: 1;
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  cursor: pointer;
  transition: background var(--transition);
}
.lightbox-close:hover { background: rgba(255, 255, 255, 0.22); }
.lightbox-close:focus-visible {
  outline-color: #fff;
}
@media (max-width: 600px) {
  .lightbox { padding: 16px; }
  .lightbox-close { top: 12px; right: 12px; }
}

.article-share {
  margin-top: 40px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.article-share .share-label {
  font-size: 13.5px;
  color: var(--muted);
  margin-right: 2px;
}
.article-share a,
.article-share button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
  padding: 6px 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  cursor: pointer;
  transition: all var(--transition);
}
.article-share a:hover,
.article-share button:hover {
  color: var(--accent-hover);
  border-color: var(--accent);
  background: rgba(31, 58, 138, 0.04);
}
.article-share button.copied {
  color: var(--accent);
  border-color: var(--accent);
}

/* Visually hidden, still read by screen readers (e.g. the aria-live
   "link copied" announcement on the article share row). */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.article-sources {
  margin-top: 32px;
  font-size: 13.5px;
  color: var(--muted);
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.article-sources a { color: var(--accent); }

/* ===== Contact ===== */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.contact-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  height: 64px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  transition: all var(--transition);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
}
.contact-card:hover {
  border-color: var(--ink);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  color: var(--ink);
}
.contact-card .ico-badge {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform var(--transition);
}
.contact-card:hover .ico-badge { transform: scale(1.06); }
.contact-card .label { line-height: 1.2; }
.contact-card .ext {
  margin-left: auto;
  color: var(--muted-2);
  opacity: 0;
  transition: all var(--transition);
}
.contact-card:hover .ext { opacity: 1; transform: translate(2px, -2px); color: var(--accent); }

@media (max-width: 720px) {
  .contact-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 460px) {
  .contact-grid { grid-template-columns: 1fr; }
}

/* ===== Not found (404) ===== */
.notfound {
  max-width: 560px;
  margin: 0 auto;
  padding: 88px 0 96px;
  text-align: center;
}
.notfound-code {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 26px;
  margin-bottom: 28px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 40px;
  font-weight: 500;
  letter-spacing: 0.12em;
  color: var(--accent);
  background-color: var(--surface);
  /* Same diagonal hairline texture as the .ph cover placeholder — a quiet
     nod to the site's pattern language, kept light. */
  background-image:
    linear-gradient(135deg, transparent 0 49%, rgba(31,58,138,0.05) 49% 51%, transparent 51% 100%);
  background-size: 14px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.notfound h1 {
  font-size: clamp(26px, 3.2vw, 34px);
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 700;
  margin: 0 0 10px;
  color: var(--ink);
  text-wrap: balance;
}
.notfound-sub {
  margin: 0 0 32px;
  font-size: 15px;
  color: var(--muted);
}
.notfound-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
}

/* ===== Footer ===== */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 24px 0;
}
.site-footer-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 28px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 13px;
  color: var(--muted);
}
.site-footer .copy { display: flex; align-items: center; gap: 6px; }

/* ===== Responsive ===== */
@media (max-width: 820px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 40px;
    padding: 48px 0 32px;
  }
  .hero-text h1 { line-height: 1.18; }
  .hero-photo { max-width: 320px; margin: 0 auto; }
  .nav { gap: 16px; }
  .nav a { font-size: 13px; }
  .site-header-inner { padding: 14px 20px; }
  main { padding: 0 20px 16px; }
  .site-footer-inner { padding: 0 20px; }
}

/* ===== Accessibility: respect user motion preferences ===== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
