:root {
  --bg: #0e1116;
  --text: #d6dde6;
  --dim: #828d9c;
  --accent: #ffb454;
  --line: #242b35;
  --panel: #141921;
  --button: rgba(20, 25, 33, 0.55);
  --dot: rgba(130, 141, 156, 0.1);
  --dot-bright: rgba(255, 190, 120, 0.55);
}

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

body {
  background-color: var(--bg);
  background-image:
    radial-gradient(circle, var(--dot) 3px, transparent 3.1px),
    radial-gradient(circle, var(--dot) 3px, transparent 3.1px);
  background-size: 26px 52px;
  background-position:
    -13px -13px,
    0 13px;
  background-attachment: fixed;
  color: var(--text);
  font-family: "IBM Plex Sans", system-ui, sans-serif;
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  padding: clamp(0.85rem, 3.5vw, 2.5rem);
}

.mono {
  font-family: "IBM Plex Mono", monospace;
}

a {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  transition:
    color 140ms ease,
    border-color 140ms ease;
}
a:hover {
  color: var(--accent);
  border-color: var(--accent);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 1px;
}

/* ---------- Cursor spotlight on the dot field ---------- */

.dot-glow {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle, var(--dot-bright) 3px, transparent 3.1px),
    radial-gradient(circle, var(--dot-bright) 3px, transparent 3.1px);
  background-size: 26px 52px;
  background-position:
    -13px -13px,
    0 13px;
  background-attachment: fixed;
  -webkit-mask-image: radial-gradient(
    300px 300px at var(--mx, -100%) var(--my, -100%),
    #000 0%,
    rgba(0, 0, 0, 0) 72%
  );
  mask-image: radial-gradient(
    300px 300px at var(--mx, -100%) var(--my, -100%),
    #000 0%,
    rgba(0, 0, 0, 0) 72%
  );
  opacity: 0;
  transition: opacity 280ms ease;
}
.dot-glow.is-active {
  opacity: 1;
}

.page {
  position: relative;
  z-index: 1;
  max-width: 42rem;
  margin: 0 auto;
  padding: clamp(2.5rem, 8vw, 5.5rem) clamp(1.5rem, 5vw, 3.25rem) 4rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow:
    0 2px 4px rgba(0, 0, 0, 0.25),
    0 8px 16px rgba(0, 0, 0, 0.3),
    0 18px 40px rgba(0, 0, 0, 0.4),
    0 40px 80px rgba(0, 0, 0, 0.5);
}
/* card content sits above the glow layers (::before / ::after) */
.page > header,
.page > main,
.page > footer {
  position: relative;
  z-index: 1;
}
/* a soft circle of light follows the pointer across the card surface */
.page::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(
    440px 440px at var(--cmx, -100%) var(--cmy, -100%),
    rgba(255, 190, 120, 0.05) 0%,
    rgba(255, 190, 120, 0.036) 22%,
    rgba(255, 190, 120, 0.02) 45%,
    rgba(255, 190, 120, 0.009) 65%,
    rgba(255, 190, 120, 0.003) 84%,
    rgba(0, 0, 0, 0) 100%
  );
  opacity: 0;
  transition: opacity 280ms ease;
}
.page.is-active::before {
  opacity: 1;
}
/* border lights up in the same soft circle that follows the pointer */
.page::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 1px solid var(--accent);
  pointer-events: none;
  /* above the card background, below content so photos cover the arc */
  z-index: 0;
  opacity: 0;
  transition: opacity 280ms ease;
  -webkit-mask-image: radial-gradient(
    300px 300px at var(--cmx, -100%) var(--cmy, -100%),
    #000 0%,
    rgba(0, 0, 0, 0) 72%
  );
  mask-image: radial-gradient(
    300px 300px at var(--cmx, -100%) var(--cmy, -100%),
    #000 0%,
    rgba(0, 0, 0, 0) 72%
  );
}
.page.is-active::after {
  opacity: 1;
}

/* ---------- Header ---------- */

header {
  margin-bottom: 3.5rem;
}

h1 {
  font-family: "IBM Plex Mono", monospace;
  font-size: clamp(2.1rem, 7vw, 3rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.1;
  text-shadow: 3px 3px 0 rgba(0, 0, 0, 0.55);
}
.typed::after {
  content: "_";
  color: var(--accent);
  animation: blink 1.1s steps(2) infinite;
}
@keyframes blink {
  50% {
    opacity: 0;
  }
}

.typed {
  white-space: nowrap;
}

.role {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.875rem;
  color: var(--dim);
  margin-top: 0.5rem;
}

.intro {
  font-size: 1.0625rem;
  max-width: 38rem;
  margin-top: 1.9rem;
}
.intro .prompt {
  display: block;
  font-family: "IBM Plex Mono", monospace;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 0.3rem;
}

.contact-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.5rem;
  margin-top: 1.6rem;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.8125rem;
  color: var(--dim);
}
.contact-row a {
  color: var(--dim);
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
}
.contact-row a:hover {
  color: var(--accent);
}
.contact-row a svg {
  width: 1.05em;
  height: 1.05em;
  flex: none;
  fill: currentColor;
}

/* ---------- Download CV button ---------- */

.download-cv {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.8125rem;
  color: var(--dim);
  background: var(--button);
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 0.45rem 0.85rem;
  cursor: pointer;
  transition:
    color 140ms ease,
    border-color 140ms ease;
}
.download-cv .print-icon {
  width: 1.15em;
  height: 1.15em;
  flex: none;
  color: var(--accent);
}
.download-cv:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* ---------- Language switcher ---------- */

.lang-switch {
  position: absolute;
  top: clamp(1rem, 3vw, 1.6rem);
  right: clamp(1.1rem, 4vw, 2rem);
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: var(--dim);
}
.lang-switch a {
  color: var(--dim);
  border-bottom: none;
}
.lang-switch a:hover {
  color: var(--accent);
}
.lang-switch [aria-current="page"] {
  color: var(--accent);
}
.lang-switch .sep {
  color: var(--line);
}

/* shown only when printing / saving to PDF */
.print-name {
  display: none;
}

/* ---------- Sections ---------- */

section {
  margin-bottom: 3.25rem;
}

h2 {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--dim);
  letter-spacing: 0.04em;
  border-top: 1px solid var(--line);
  padding-top: 0.85rem;
  margin-bottom: 1.75rem;
  text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.55);
}
h2 .idx {
  color: var(--accent);
}

/* ---------- Entries (editorial grid: date | content) ---------- */

.entry {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: 1.4rem;
  margin-bottom: 2.25rem;
}
.entry:last-child {
  margin-bottom: 0;
}

.entry-when {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.75rem;
  color: var(--dim);
  padding-top: 0.35rem;
}

.entry h3 {
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.4;
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.5);
}
.entry h3 .at {
  color: var(--dim);
  font-weight: 400;
}

.entry p {
  margin-top: 0.45rem;
  color: var(--text);
}

.entry ul {
  list-style: none;
  margin-top: 0.6rem;
}
.entry li {
  padding-left: 1.2rem;
  position: relative;
  margin-bottom: 0.45rem;
}
.entry li::before {
  content: ">";
  font-family: "IBM Plex Mono", monospace;
  position: absolute;
  left: 0;
  color: var(--accent);
}

.tags {
  margin-top: 0.8rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.tag {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.6875rem;
  color: var(--dim);
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 0.15rem 0.5rem;
  border-radius: 2px;
}

/* ---------- Skills ---------- */

.skills {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
  gap: 0.55rem 1.5rem;
}
.skills li {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.8125rem;
  padding-left: 2ch;
  text-indent: -2ch;
}
.skills li::before {
  content: "- ";
  color: var(--accent);
}

/* ---------- Polaroid (pinned photo) ---------- */

.polaroid {
  float: right;
  width: clamp(190px, 44%, 224px);
  margin: 0.4rem 0 0.9rem 1.6rem;
  padding: 0.55rem 0.55rem 0;
  background: #f3efe6;
  border-radius: 2px;
  box-shadow:
    0 12px 28px rgba(0, 0, 0, 0.5),
    0 2px 6px rgba(0, 0, 0, 0.35);
  /* pinned tilt + a slight 3D turn toward the pointer (--tilt-x/--tilt-y) */
  --base-rot: 2.4deg;
  transform: perspective(760px) rotateZ(var(--base-rot))
    rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg));
  transition: transform 180ms ease-out;
  position: relative;
}
.polaroid img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 1px;
}
/* headshot variant in the header — counter-tilt, slightly smaller */
.polaroid-intro {
  width: clamp(158px, 38%, 190px);
  margin-top: 0.2rem;
  --base-rot: -2.2deg;
}
/* keep the face nicely framed in the square crop */
.polaroid-intro img {
  object-position: center 20%;
}

/* museum photo bleeds a bit past the content edge on wide screens;
   the bleed scales down to 0 as the window narrows, so it never overflows */
.polaroid-out {
  margin-right: clamp(-7rem, (42rem - 100vw) / 2 + 1rem, 0rem);
}
.polaroid figcaption {
  font-family: "Caveat", cursive;
  font-size: 1.2rem;
  line-height: 1.1;
  text-align: center;
  color: #3a3531;
  padding: 0.45rem 0.2rem 0.7rem;
}
/* ---------- Footer ---------- */

footer {
  border-top: 1px solid var(--line);
  padding-top: 1.1rem;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.75rem;
  color: var(--dim);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
}

/* ---------- Motion ---------- */

@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
header,
section,
footer {
  animation: fade-in 550ms ease-out both;
}
header {
  animation-delay: 0ms;
}
section:nth-of-type(1) {
  animation-delay: 90ms;
}
section:nth-of-type(2) {
  animation-delay: 180ms;
}
section:nth-of-type(3) {
  animation-delay: 270ms;
}
section:nth-of-type(4) {
  animation-delay: 360ms;
}
footer {
  animation-delay: 450ms;
}

@media (prefers-reduced-motion: reduce) {
  header,
  section,
  footer,
  .typed::after {
    animation: none;
  }
}

@media (max-width: 540px) {
  /* card fills the whole screen on phones */
  body {
    padding: 0;
  }
  .page {
    max-width: none;
    margin: 0;
    min-height: 100vh;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
  .entry {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }
  .entry-when {
    padding-top: 0;
  }
  .polaroid {
    float: none;
    width: 220px;
    margin: 0.7rem auto 1.1rem;
  }
  /* let the photo follow the text instead of sitting above the name */
  header {
    display: flex;
    flex-direction: column;
  }
  .polaroid-intro {
    order: 1;
    margin: 1.5rem auto 0;
  }
}

@media (max-width: 720px) {
  .contact-row {
    flex-direction: column;
    align-items: start;
    gap: 1rem;
  }
}

/* ---------- Print / Save as PDF ---------- */

@media print {
  /* the site is dark-mode only; on paper we flip to a light document so
     the ink is dark text on white, whether or not "background graphics"
     is enabled in the print dialog */
  :root {
    color-scheme: light;
    --text: #1a1a1a;
    --dim: #555555;
    --accent: #b4540a;
    --line: #cccccc;
  }

  @page {
    margin: 16mm 14mm;
  }

  html,
  body {
    background: #ffffff;
    color: var(--text);
    font-size: 10.5pt;
    line-height: 1.45;
    padding: 0;
  }

  /* the card is a screen effect: on paper it's just the document, so drop
     the frame, rounded corners, and drop-shadow that were bleeding in */
  .page {
    max-width: none;
    margin: 0;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
  /* pointer-driven glow layers have nothing to do on paper */
  .dot-glow,
  .page::before,
  .page::after {
    display: none !important;
  }

  /* decorative / interactive bits have no place in the document */
  .frame,
  footer,
  .lang-switch,
  .typed,
  .typed::after,
  .polaroid-out {
    display: none !important;
  }

  /* stop the animation flicker and reveal the real name */
  header,
  section,
  footer {
    animation: none !important;
  }
  .print-name {
    display: inline;
  }

  h1 {
    font-size: 22pt;
  }
  header {
    margin-bottom: 1.4rem;
  }
  .intro {
    margin-top: 1rem;
  }

  /* keep contact details, drop the icons for a clean line */
  .contact-row {
    margin-top: 1rem;
    gap: 0.2rem 1.4rem;
    color: var(--text);
  }
  .contact-row a,
  a {
    color: var(--text);
    border-bottom: none;
  }
  .contact-row a svg {
    display: none;
  }

  /* the headshot is nice to keep — just calm it down for paper */
  .polaroid-intro {
    box-shadow: none;
    transform: none;
    border: 1px solid var(--line);
    width: 150px;
  }

  section {
    margin-bottom: 1.5rem;
  }
  h2 {
    color: var(--text);
  }

  /* don't split a role across a page break */
  .entry {
    break-inside: avoid;
  }

  /* the sharp shadow is a screen effect only — keep paper crisp */
  h1,
  h2,
  .entry h3 {
    text-shadow: none;
  }
}
