/* ---------- Fonts, hosted on this site (SIL Open Font License, see assets/fonts/*-OFL.txt) ----------
   A "latin-ext" file is downloaded only when the page has a letter from its range. */
@font-face {
  font-family: "Inter Tight";
  src: url("assets/fonts/InterTight-latin-ext.woff2") format("woff2");
  font-weight: 400 600;
  font-display: swap;
  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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Inter Tight";
  src: url("assets/fonts/InterTight-latin.woff2") format("woff2");
  font-weight: 400 600;
  font-display: swap;
  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: "Space Grotesk";
  src: url("assets/fonts/SpaceGrotesk-latin-ext.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
  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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Space Grotesk";
  src: url("assets/fonts/SpaceGrotesk-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
  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: "JetBrains Mono";
  src: url("assets/fonts/JetBrainsMono-latin-ext.woff2") format("woff2");
  font-weight: 400 500;
  font-display: swap;
  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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("assets/fonts/JetBrainsMono-latin.woff2") format("woff2");
  font-weight: 400 500;
  font-display: swap;
  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;
}

/* ---------- 1. Colours (change these to restyle the whole site) ---------- */
:root,
[data-theme="dark"] {
  --bg: #0e1014;
  --card: #171a21;
  --line: #262b34;
  --text: #edeff3;
  --muted: #aeb4bf;
  --accent: #7aa7ff;
  --on-accent: #0e1014;
  --btn-border: #3a404b;
  --tile-bg: #0e1014;
  --tile-border: #2c323c;
  --tag-border: #333945;
  --preview-ink: #0e1014;
  --tint-1: #9db8f0;
  --tint-2: #a7d8c8;
  --tint-3: #e8c9a0;
  --tint-4: #c3d3ac;
  color-scheme: dark;
}
[data-theme="light"] {
  --bg: #f7f8fa;
  --card: #ffffff;
  --line: #e1e4ea;
  --text: #14161b;
  --muted: #555b66;
  --accent: #2f5fd0;
  --on-accent: #ffffff;
  --btn-border: #c9ced8;
  --tile-bg: #eef2fc;
  --tile-border: #d8e0f4;
  --tag-border: #d2d7e0;
  --preview-ink: #ffffff;
  --tint-1: #d6e2fa;
  --tint-2: #d2ebe0;
  --tint-3: #f3e3cd;
  --tint-4: #dce6cb;
  color-scheme: light;
}

/* ---------- 2. Base ---------- */
* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
  scroll-padding-top: 24px;
  overflow-x: clip;
}
body {
  margin: 0;
  overflow-x: clip;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter Tight", sans-serif;
  line-height: 1.5;
}
a {
  color: inherit;
  text-decoration: none;
}
a:hover {
  color: var(--accent);
}
h1,
h2,
h3 {
  font-family: "Space Grotesk", sans-serif;
  margin: 0;
}
p {
  margin: 0;
}
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.container {
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 clamp(20px, 4vw, 48px);
}
section {
  padding-bottom: clamp(96px, 14vw, 150px);
}
.section-title {
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.muted {
  color: var(--muted);
}

/* Two-column section: title on the left, content on the right */
.split {
  display: flex;
  flex-wrap: wrap;
  gap: 24px 64px;
}
.split > h2 {
  flex: 0 0 240px;
}
.split > .content {
  flex: 1 1 480px;
  min-width: 0;
}
/* About: the portrait sits in the left column. Its heading stays for screen readers and the menu link, but is not shown. */
.split > .about-side {
  flex: 0 0 240px;
}
.about-photo {
  display: block;
  width: clamp(140px, 16vw, 200px);
  height: clamp(140px, 16vw, 200px);
  border: 3px solid var(--line);
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.25);
}
.about-name {
  width: clamp(140px, 16vw, 200px);
  margin: 14px 0 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: 22px;
  font-weight: 600;
  text-align: center;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- 3. Buttons ---------- */
.btn {
  display: inline-block;
  font: inherit;
  font-weight: 600;
  padding: 15px 30px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
}
.btn-primary {
  background: var(--accent);
  color: var(--on-accent);
}
.btn-primary:hover {
  color: var(--on-accent);
  opacity: 0.9;
}
.btn-outline {
  border-color: var(--btn-border);
  color: var(--text);
  background: transparent;
}
.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* ---------- 4. Header ---------- */
header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  padding: 28px 0;
}
/* Chillax (Fontshare, ITF Free Font License, see assets/fonts/Chillax-FFL.txt): used only for the logo */
@font-face {
  font-family: "Chillax";
  src: url("assets/fonts/Chillax-Variable.woff2") format("woff2");
  font-weight: 200 700;
  font-display: swap;
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  font-family: "Chillax", "Space Grotesk", sans-serif;
  font-weight: 600;
  font-size: 24px;
  text-transform: lowercase;
}
.logo img {
  display: block;
  width: 36px;
  height: 36px;
  flex: none;
}
.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--btn-border);
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}
.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  display: block;
  width: 20px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
}
.nav-toggle span {
  position: relative;
  margin: 0 auto;
}
.nav-toggle span::before,
.nav-toggle span::after {
  position: absolute;
  left: 0;
  content: "";
}
.nav-toggle span::before {
  top: -6px;
}
.nav-toggle span::after {
  top: 6px;
}
nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 28px;
}
.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
nav a.nav-link {
  color: var(--muted);
}
nav a.nav-link:hover {
  color: var(--accent);
}
.nav-cta {
  padding: 10px 22px;
}
#theme-toggle {
  padding: 9px 16px;
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
}

/* ---------- 5. Hero ---------- */
.hero {
  position: relative;
  /* padding-top: clamp(80px, 13vw, 100px); */
  padding-top: 70px;
}
.status {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 32px;
  font-size: 18px;
  color: var(--muted);
}
.dot {
  flex: none;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
}
.hero h1 {
  max-width: 900px;
  margin-bottom: 32px;
  font-size: clamp(46px, 7vw, 104px);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.04em;
}
/* Headline words that take turns, after the 21st.dev "animated hero" (site.js draws them, lib/headline-words.js
   moves the marks). The line of words sits on its own row inside a clipping box. The words are stacked on top of
   each other: the one showing is "is-on", words earlier in the list wait above ("is-above"), later ones below.
   The easing is a spring (stiffness 50, damping 10) drawn as a CSS curve: it overshoots a little, then settles. */
.hl-words {
  position: relative;
  display: flex;
  justify-content: center;
  overflow: hidden;
  padding-top: 0.06em;
  padding-bottom: 0.2em; /* room for the tails of g, y, p */
}
.hl-words::before {
  content: "\00a0"; /* holds the height of one line; the words themselves are absolute */
}
.hl-word {
  position: absolute;
  font-weight: 600;
  color: var(--accent);
  opacity: 0;
  transform: translateY(2em);
  transition:
    opacity 1.3s ease,
    transform 1.3s cubic-bezier(0.34, 1.3, 0.64, 1);
  transition:
    opacity 1.3s
      linear(
        0,
        0.046,
        0.156,
        0.298,
        0.447,
        0.588,
        0.712,
        0.814,
        0.894,
        0.954,
        0.995,
        1.022,
        1.036,
        1.042,
        1.043,
        1.039,
        1.034,
        1.027,
        1.021,
        1.015,
        1.01,
        1.006,
        1.003,
        1.001,
        1,
        0.999,
        0.998,
        0.998,
        0.998
      ),
    transform 1.3s
      linear(
        0,
        0.046,
        0.156,
        0.298,
        0.447,
        0.588,
        0.712,
        0.814,
        0.894,
        0.954,
        0.995,
        1.022,
        1.036,
        1.042,
        1.043,
        1.039,
        1.034,
        1.027,
        1.021,
        1.015,
        1.01,
        1.006,
        1.003,
        1.001,
        1,
        0.999,
        0.998,
        0.998,
        0.998
      );
}
.hl-word.is-on {
  opacity: 1;
  transform: none;
}
.hl-word.is-above {
  transform: translateY(-2em);
}
/* A heading with changing words: light first line (the words are semibold) and tighter letters, as in the original */
:is(.hero h1, .contact-info h2):has(.hl-words) {
  font-weight: 400;
  letter-spacing: -0.05em;
}
.hero p.intro {
  max-width: 540px;
  margin-bottom: 44px;
  font-size: 22px;
  line-height: 1.55;
  color: var(--muted);
}

/* Hero: text on the left, a browser window cycling through project screenshots on the right */
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 48px;
  align-items: center;
}
.hero-grid h1 {
  font-size: clamp(40px, 3.7vw, 64px);
}
/* Let the project window bleed past the viewport edge without adding horizontal scroll. */
.hero-visual {
  transform: translateY(-16px);
  margin-right: calc(
    -1 * (max(0px, (100vw - 1360px) / 2) + clamp(20px, 4vw, 48px) + 12px)
  );
}
@media (min-width: 1600px) {
  .hero-visual {
    margin-right: calc(
      -1 * (max(0px, (100vw - 1360px) / 2) + clamp(20px, 4vw, 48px) + 40px)
    );
  }
}
.hero-grid .intro {
  margin-bottom: 36px;
}
.hero-win {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4);
}
.hero-win-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}
.hero-win-dots {
  display: flex;
  gap: 6px;
}
.hero-win-dots i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--line);
}
.hero-win-dots i:nth-child(1) {
  background: #d06b66;
}
.hero-win-dots i:nth-child(2) {
  background: #d2ad54;
}
.hero-win-dots i:nth-child(3) {
  background: #68aa78;
}
.hero-win-url {
  flex: 1;
  padding: 4px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font:
    500 12.5px "JetBrains Mono",
    monospace;
  color: var(--muted);
}
.hero-shots {
  position: relative;
  aspect-ratio: 16 / 10;
  background: var(--card);
}
.hero-shot {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.6s ease;
}
.hero-shot.on {
  opacity: 1;
}
.hero-shot img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}
.hero-picker {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 16px;
  font-size: 15px;
}
.hero-picker-dots {
  display: flex;
  gap: 8px;
}
.hero-picker-dots button {
  width: 28px;
  height: 6px;
  padding: 0;
  border: 0;
  border-radius: 3px;
  background: var(--line);
  cursor: pointer;
}
.hero-picker-dots button[aria-current="true"] {
  background: var(--accent);
}
@media (max-width: 900px) {
  header {
    column-gap: 16px;
  }
  /* About: once the portrait wraps above the text, it takes the full width and its photo and name sit in the middle */
  .split > .about-side {
    flex-basis: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  .nav-toggle {
    display: block;
    margin-left: auto;
  }
  header > nav {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--card);
  }
  header > nav[data-open="true"] {
    display: flex;
  }
  header > nav .nav-link {
    padding: 10px 12px;
  }
  .nav-actions {
    flex-wrap: wrap;
  }
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .hero-visual {
    transform: none;
    margin-right: 0;
  }
}

/* ---------- 6. About ---------- */
.about-lead {
  margin-bottom: 40px;
  font-size: clamp(22px, 2.4vw, 30px);
  line-height: 1.5;
}
.about-points {
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
}
.about-points > div {
  flex: 1 1 260px;
}
.about-points h3 {
  margin-bottom: 8px;
  font-size: 20px;
  font-weight: 600;
}
.about-points p {
  font-size: 17px;
  color: var(--muted);
}

/* ---------- 7. Skills ---------- */
.skill-groups {
  display: flex;
  flex-direction: column;
  gap: 56px;
  margin-top: 56px;
}
.skill-groups h3 {
  margin-bottom: 20px;
  font-size: 22px;
  font-weight: 500;
  color: var(--muted);
}
.skill-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}
.skill-card {
  flex: 0 0 160px;
  min-width: 0;
  padding: 22px 20px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.skill-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  margin-bottom: 18px;
  border-radius: 10px;
  background: var(--tile-bg);
  border: 1px solid var(--tile-border);
  color: var(--accent);
  font-family: "JetBrains Mono", monospace;
  font-weight: 500;
  font-size: 15px;
}
.skill-icon .ico {
  display: block;
  width: 24px;
  height: 24px;
  background: currentColor;
  -webkit-mask: var(--icon) center / contain no-repeat;
  mask: var(--icon) center / contain no-repeat;
}
.skill-name {
  font-size: 17px;
  font-weight: 500;
  line-height: 1.3;
}

/* ---------- 8. Projects ---------- */
/* auto-fill keeps empty columns, so a lone last card stays one column wide instead of stretching across the row */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(440px, 100%), 1fr));
  gap: 24px;
  margin-top: 56px;
}
.project {
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
}
.project-preview {
  height: 260px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.project-preview.shot {
  display: block;
  padding: 0;
  overflow: hidden;
  background: var(--tint-4);
}
.project-preview.shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  transition: transform 0.35s ease;
}
.project-preview.shot:hover img {
  transform: scale(1.03);
}
.project-preview .bar {
  height: 12px;
  border-radius: 4px;
  background: var(--preview-ink);
}
.project-preview .blocks {
  margin-top: auto;
  display: flex;
  gap: 10px;
}
.project-preview .block {
  flex: 1 1 0;
  height: 64px;
  border-radius: 8px;
  background: var(--preview-ink);
  opacity: 0.8;
}
.project-body {
  padding: 28px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}
.project-media {
  position: relative;
}
.case-peek {
  position: absolute;
  right: 16px;
  bottom: 16px;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 15px;
  font-weight: 600;
  opacity: 0;
  transform: translateY(6px);
  transition:
    opacity 0.25s ease,
    transform 0.25s ease;
}
.case-peek:hover {
  color: var(--on-accent);
  opacity: 1;
}
.project:hover .case-peek,
.project:focus-within .case-peek {
  opacity: 1;
  transform: none;
}
@media (hover: none) {
  .case-peek {
    opacity: 1;
    transform: none;
  }
}

/* Case study pop-up: a <dialog> shows the case-study page in a frame. */
.case-dialog {
  width: min(1000px, calc(100% - 24px));
  height: min(900px, calc(100% - 24px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
}
.case-dialog[open] {
  display: flex;
  flex-direction: column;
}
.case-dialog::backdrop {
  background: rgba(0, 0, 0, 0.65);
}
.case-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}
.case-bar strong {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: "Space Grotesk", sans-serif;
  font-size: 18px;
}
.case-bar a {
  font-size: 15px;
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
}
.case-bar button {
  padding: 6px 14px;
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
}
.case-dialog iframe {
  flex: 1;
  width: 100%;
  border: 0;
  background: var(--bg);
}
body:has(.case-dialog[open]) {
  overflow: hidden;
}
.project[hidden] {
  display: none;
}
.project-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-bottom: 14px;
}
.project-type {
  font:
    500 13px "JetBrains Mono",
    monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}
.project-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 40px;
}
.project-filter + .project-grid {
  margin-top: 28px;
}
.filter-chip {
  padding: 9px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font:
    500 15px "Inter Tight",
    sans-serif;
  cursor: pointer;
}
.filter-chip:hover {
  color: var(--text);
  border-color: var(--muted);
}
.filter-chip[aria-pressed="true"] {
  border-color: var(--accent);
  color: var(--accent);
}
.project-body h3 {
  margin-bottom: 12px;
  font-size: 26px;
  font-weight: 600;
}
.project-body p {
  margin-bottom: 20px;
  font-size: 17px;
  color: var(--muted);
}
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 24px;
  padding: 0;
  list-style: none;
}
.tags li {
  padding: 3px 10px;
  border: 1px solid var(--tag-border);
  border-radius: 6px;
  font-family: "JetBrains Mono", monospace;
  font-size: 12.5px;
}
.project-links {
  display: flex;
  gap: 24px;
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-weight: 600;
  color: var(--accent);
}

/* ---------- 9. Experience and education ---------- */
.job + .job {
  margin-top: 56px;
}
.job-year {
  margin-bottom: 8px;
  font-size: 17px;
  color: var(--muted);
}
.job-title {
  margin-bottom: 4px;
  font-size: 28px;
  font-weight: 600;
}
.job-place {
  margin-bottom: 24px;
  font-size: 18px;
  color: var(--muted);
}
.job-point {
  margin-bottom: 14px;
  font-size: 19px;
}
.also {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  font-size: 17px;
  color: var(--muted);
}

.degree {
  margin-bottom: 40px;
}
.degree h3 {
  margin-bottom: 8px;
  font-size: 26px;
  font-weight: 600;
  line-height: 1.25;
}
.degree p {
  font-size: 18px;
  color: var(--muted);
}
.cert-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}
.cert {
  flex: 1 1 260px;
  padding: 24px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.cert h3 {
  margin-bottom: 6px;
  font-size: 21px;
  font-weight: 600;
}
.cert p {
  margin-bottom: 16px;
  font-size: 16px;
  color: var(--muted);
}
.badge {
  display: inline-block;
  padding: 4px 14px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
}

/* ---------- 10. Contact ---------- */
.contact-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  text-align: center;
  padding: clamp(28px, 6vw, 80px);
  background: var(--card);
  border-block: 1px solid var(--line);
  /* Full bleed: the box runs edge to edge of the window, while its text (.contact-info) stays centred */
  width: 100vw;
  margin-inline: calc(50% - 50vw);
}
.contact-info {
  width: 100%;
  max-width: 780px;
  min-width: 0;
}
.contact-info h2 {
  margin-bottom: 20px;
  font-size: clamp(38px, 4.6vw, 64px);
  font-weight: 600;
  line-height: 1.04;
  letter-spacing: -0.035em;
}
.contact-info p {
  max-width: 600px;
  margin-inline: auto;
  margin-bottom: 24px;
  font-size: 20px;
  color: var(--muted);
}
.contact-info .email {
  font-size: 20px;
  font-weight: 500;
}
.contact-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 28px;
}
form {
  flex: 1 1 340px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
label {
  font-size: 16px;
  font-weight: 600;
}
input,
textarea {
  font: inherit;
  font-size: 17px;
  padding: 14px 16px;
  background: var(--tile-bg);
  color: var(--text);
  border: 1px solid var(--tag-border);
  border-radius: 8px;
}
textarea {
  resize: vertical;
}
form .btn {
  align-self: flex-start;
}

footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 24px 0 48px;
  font-size: 15px;
  color: var(--muted);
}
footer .links {
  display: flex;
  gap: 24px;
}
/* "Back to top" at the end of the footer. It is not inside the parts the admin redraws. */
footer .to-top {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  font-weight: 500;
  transition:
    border-color 0.2s ease,
    color 0.2s ease;
}
footer .to-top:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Bar shown only in the admin's preview of the full site */
.preview-bar {
  position: fixed;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px 12px;
  max-width: calc(100% - 24px);
  padding: 10px 16px;
  border: 1px solid var(--accent);
  border-radius: 12px;
  background: var(--card);
  color: var(--text);
  font-size: 15px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}
.preview-bar a {
  color: var(--accent);
  font-weight: 600;
}

/* ---------- Phones: menu in two rows, skills in two columns, roomier project text ---------- */
@media (max-width: 640px) {
  .skill-groups {
    gap: 40px;
    margin-top: 40px;
  }
  /* Small cards, as many per row as fit (3 on a phone), instead of one big card per row */
  .skill-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
    gap: 10px;
  }
  .skill-card {
    min-width: 0;
    padding: 12px 10px;
    border-radius: 12px;
  }
  .skill-icon {
    width: 36px;
    height: 36px;
    margin-bottom: 10px;
  }
  .skill-icon .ico {
    width: 20px;
    height: 20px;
  }
  .skill-name {
    font-size: 14px;
    overflow-wrap: anywhere;
  }
  .project-body {
    padding: 22px;
  }
}

/* "Site hidden" page, shown instead of the portfolio when the owner hides the site from the admin */
/* Text saved from the admin keeps its line breaks: Enter makes a new line, a blank line makes a new paragraph.
       Only for drawn content (data-live), so the spacing in the built-in HTML is unaffected. */
[data-live]
  :is(
    .hero-copy h1,
    .hero-copy .intro,
    .about-lead,
    .about-points p,
    .project-body p,
    .job-point,
    .also,
    .degree p,
    .cert p,
    .contact-info p
  ) {
  white-space: pre-line;
}

/* While the saved content loads (a script in index.html sets this class), the page text stays invisible,
   so the built-in text never shows first and then swaps to the saved text. Layout is kept, so nothing jumps. */
main,
footer {
  transition: opacity 0.2s ease;
}
html.content-pending main,
html.content-pending footer {
  opacity: 0;
}

/* A section the owner has hidden (set by applyLayout in site.js), and the menu links to it. */
[data-layout-hidden] {
  display: none !important;
}
#closed {
  display: none;
}
html[data-site="hidden"] .container {
  display: none;
}
html[data-site="hidden"] #closed {
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 16px;
  min-height: 100vh;
  padding: 24px;
  text-align: center;
}
#closed h1 {
  font-size: clamp(36px, 6vw, 72px);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.035em;
}
#closed p {
  max-width: 46ch;
  font-size: 20px;
  color: var(--muted);
}

/* ---------- Motion (public page only: html.fx is set in index.html, not in the admin) ---------- */
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
/* Hero: the text comes up one line after another. The project window has no fade, so its picture shows at once. */
html.fx .hero-copy > * {
  animation: rise 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}
html.fx .hero-copy > :nth-child(2) {
  animation-delay: 0.08s;
}
html.fx .hero-copy > :nth-child(3) {
  animation-delay: 0.16s;
}
html.fx .hero-copy > :nth-child(4) {
  animation-delay: 0.24s;
}
/* A soft blue light that follows the mouse (added by lib/effects.js; only with a mouse, never on touch screens) */
.cursor-glow {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 40;
  width: 480px;
  height: 480px;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(
    circle,
    rgba(122, 167, 255, 0.2) 0%,
    rgba(122, 167, 255, 0) 65%
  );
  background: radial-gradient(
    circle,
    color-mix(in srgb, var(--accent) 24%, transparent) 0%,
    transparent 65%
  );
  opacity: 0;
  transition: opacity 0.4s ease;
  will-change: transform;
}
.cursor-glow.on {
  opacity: 1;
}
/* Emoji that pop around the mouse in the contact section (added by lib/emoji-pop.js) */
.emoji-pop {
  position: fixed;
  z-index: 45;
  font-size: 26px;
  line-height: 1;
  pointer-events: none;
  user-select: none;
  will-change: transform, opacity;
}
/* Small hover touches */
html.fx .project,
html.fx .skill-card {
  transition:
    transform 0.25s ease,
    border-color 0.25s ease;
}
html.fx .project:hover,
html.fx .skill-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
}
html.fx .btn:active {
  transform: scale(0.97);
}
html.fx footer .to-top span {
  transition: transform 0.2s ease;
}
html.fx footer .to-top:hover span {
  transform: translateY(-3px);
}
html.fx .about-photo {
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
html.fx .about-photo:hover {
  transform: scale(1.05) rotate(-2deg);
}
/* The menu link of the section being read (set by lib/effects.js) */
nav a.nav-link.is-active {
  color: var(--accent);
}
/* Thin progress bar along the top; lib/effects.js fills it as you scroll */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 60;
  height: 3px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: 0 50%;
  pointer-events: none;
}
/* The case-study pop-up grows in */
html.fx .case-dialog[open] {
  animation: pop 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}
html.fx .case-dialog[open]::backdrop {
  animation: fade 0.28s ease;
}
@keyframes pop {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.98);
  }
}
/* Dark / light switch: colours fade instead of snapping. The class is added by the toggle script in index.html for
   0.45 s only. The cycling headline words keep their own spring. */
@media (prefers-reduced-motion: no-preference) {
  html.theme-fade,
  html.theme-fade *:not(.hl-word),
  html.theme-fade *:not(.hl-word)::before,
  html.theme-fade *:not(.hl-word)::after {
    transition:
      background-color 0.4s ease,
      color 0.4s ease,
      border-color 0.4s ease,
      fill 0.4s ease,
      stroke 0.4s ease,
      box-shadow 0.4s ease !important;
  }
}
/* Visitors who ask their device for less motion get none of it */
@media (prefers-reduced-motion: reduce) {
  html.fx *,
  html.fx *::before,
  html.fx *::after {
    animation: none !important;
    transition: none !important;
  }
  .scroll-progress {
    display: none;
  }
}

/* ---------- Magnetic cursor (lib/magnetic-cursor.js; try it with ?cursor=magnetic) ---------- */
html.mag-cursor,
html.mag-cursor * {
  cursor: none !important;
}
/* In the case-study pop-up the page's own cursor can't be drawn above it, so the normal one comes back. */
html.mag-cursor:has(dialog[open]),
html.mag-cursor:has(dialog[open]) * {
  cursor: auto !important;
}
html.mag-cursor:has(dialog[open]) .cursor-dot,
html.mag-cursor:has(dialog[open]) .cursor-ring {
  opacity: 0 !important;
}
.cursor-dot,
.cursor-ring,
.cursor-burst {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9999;
  pointer-events: none;
}
.cursor-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
  mix-blend-mode: difference;
  opacity: 0;
  transition:
    opacity 0.25s ease,
    width 0.2s ease,
    height 0.2s ease;
}
.cursor-dot.small {
  width: 5px;
  height: 5px;
}
.cursor-ring {
  width: 36px;
  height: 36px;
  border: 1.5px solid var(--accent);
  border-radius: 18px;
  background: rgba(122, 167, 255, 0.08);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  opacity: 0;
  transition:
    opacity 0.25s ease,
    background-color 0.25s ease;
}
.cursor-dot.on,
.cursor-ring.on {
  opacity: 1;
}
.cursor-ring.locked {
  background: rgba(122, 167, 255, 0.18);
  background: color-mix(in srgb, var(--accent) 18%, transparent);
}
.cursor-ring.down {
  background: rgba(122, 167, 255, 0.28);
  background: color-mix(in srgb, var(--accent) 28%, transparent);
}
.cursor-burst {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}
