
:root {  
  --ground: #262626;
  --panel: #303030;
  --ink: #f1f1ee;
  --muted: #a6a6a2;
  --line: #464646;

  --yellow: #ebbe44;
  --red: #d6382f;
  --blue: #4544a8;

  --on-yellow: #1e1e1e;
  --on-color: #ffffff;

  --header-h: 76px;
  --footer-h: 64px;

  --font-sans: "Jost", "Futura", "Century Gothic", "Avenir Next", Arial, sans-serif;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --ground: #efeff1;
    --panel: #e3e3e7;
    --ink: #1f1f21;
    --muted: #5e5e64;
    --line: #c8c8ce;
    --yellow: #e9b82e;
    --red: #c8282b;
    --blue: #2b2a78;
  }
}

:root[data-theme="light"] {
  --ground: #efeff1;
  --panel: #e3e3e7;
  --ink: #1f1f21;
  --muted: #5e5e64;
  --line: #c8c8ce;
  --yellow: #e9b82e;
  --red: #c8282b;
  --blue: #2b2a78;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h);
}

body {
  margin: 0;
  padding-inline: clamp(16px, 4vw, 64px);
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 18px;
  font-weight: 400;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: background 0.5s, color 0.5s;
}

a {
  color: inherit;
  text-decoration: none;
}

:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 3px;
}

.page {
  max-width: 1280px;
  margin-inline: auto;
}

.shape {
  display: block;
  background: var(--shape-color, var(--yellow));
}

.shape--yellow { --shape-color: var(--yellow); }
.shape--red    { --shape-color: var(--red); }
.shape--blue   { --shape-color: var(--blue); }

.shape--circle {
  border-radius: 50%;
}

.shape--triangle {
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}

.section {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 24px;
  padding-block: clamp(56px, 8vw, 112px);
  border-top: 1px solid var(--line);
}

.section--contact {
  border-bottom: 0;
}

.section__heading {
  grid-column: 1 / 5;
  align-self: start;
  position: sticky;
  top: 24px;
}

.section__shape {
  width: 64px;
  height: 64px;
  margin-bottom: 24px;
}

.section__title {
  margin: 0;
  font-size: clamp(34px, 4.6vw, 64px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.005em;
  text-transform: uppercase;
}

.section__body {
  grid-column: 5 / 13;
}

@media (max-width: 860px) {
  .section__heading,
  .section__body {
    grid-column: 1 / 13;
  }

  .section__heading {
    position: static;
    display: flex;
    align-items: center;
    gap: 20px;
  }

  .section__shape {
    width: 48px;
    height: 48px;
    margin: 0;
    flex: none;
  }
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  height: var(--header-h);
  background: color-mix(in srgb, var(--ground) 90%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.site-header__logo {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.site-header__nav {
  display: flex;
  gap: clamp(16px, 3vw, 36px);
}

.site-header__link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.site-header__icon {
  width: 12px;
  height: 12px;
  transition: transform 0.5s var(--ease);
}

.site-header__link:hover .site-header__icon {
  transform: rotate(90deg) scale(1.25);
}

/* on phones the header is solid, so content never shows through it */
@media (max-width: 860px) {
  .site-header {
    background: var(--ground);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

/* small phones: keep the logo and the three links on one line */
@media (max-width: 560px) {
  .site-header {
    gap: 8px;
  }

  .site-header__logo {
    font-size: 12px;
    letter-spacing: 0.12em;
    white-space: nowrap;
  }

  .site-header__nav {
    gap: 12px;
  }

  .site-header__link {
    gap: 6px;
    font-size: 11px;
    letter-spacing: 0.1em;
  }

  .site-header__icon {
    width: 9px;
    height: 9px;
  }
}

/* link of the section currently on screen (set in script.js) */
.site-header__link--current {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 8px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(24px, 5vw, 80px);
  align-items: center;
  padding-block: clamp(32px, 6vw, 88px) clamp(56px, 8vw, 112px);
}

.hero__intro {
  animation: rise 1s var(--ease) both;
}

.hero__title {
  margin: clamp(20px, 3vw, 36px) 0 clamp(24px, 3vw, 40px);
  font-size: clamp(52px, 9.2vw, 132px);
  font-weight: 700;
  line-height: 0.92;
  letter-spacing: -0.01em;
  text-transform: uppercase;
}

.hero__role {
  max-width: 24em;
  margin: 0;
  font-size: clamp(20px, 2.2vw, 28px);
  font-weight: 300;
  line-height: 1.4;
}

.hero__role b {
  font-weight: 500;
}

.hero__caption {
  margin: 14px 0 0;
  font-size: 12.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

@media (max-width: 860px) {
  .hero {
    grid-template-columns: 1fr;
  }
}

/* mosaic: 4x4 grid of tiles. Each tile holds one rotating shape.
   Tiles are built in script.js from the TILES list. */
.mosaic {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  max-width: 100%;
  padding: 6px;
  aspect-ratio: 1;
  background: var(--panel);
  animation: rise 1s 0.15s var(--ease) both;
}

.mosaic__tile {
  position: relative;
  overflow: hidden;
  padding: 0;
  border: 0;
  background: var(--panel);
  font: inherit;
  cursor: pointer;
}

.mosaic__tile:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: -3px;
  z-index: 1;
}

.mosaic__tile--bg-yellow { background: var(--yellow); }
.mosaic__tile--bg-red    { background: var(--red); }
.mosaic__tile--bg-blue   { background: var(--blue); }

.mosaic__rotator {
  position: absolute;
  inset: 0;
  transition: transform 0.8s var(--ease);
}

.mosaic__shape {
  position: absolute;
}

.mosaic__shape--yellow { background: var(--yellow); }
.mosaic__shape--red    { background: var(--red); }
.mosaic__shape--blue   { background: var(--blue); }
.mosaic__shape--ink    { background: var(--ink); }
.mosaic__shape--panel  { background: var(--panel); }

.mosaic__tile--quarter .mosaic__shape {
  inset: 0;
  border-radius: 100% 0 0 0;
}

.mosaic__tile--half .mosaic__shape {
  top: 0;
  left: 0;
  width: 100%;
  height: 50%;
  border-radius: 0 0 50% 50% / 0 0 100% 100%;
}

.mosaic__tile--circle .mosaic__shape {
  inset: 14%;
  border-radius: 50%;
}

.mosaic__tile--triangle .mosaic__shape {
  inset: 0;
  clip-path: polygon(0 0, 100% 100%, 0 100%);
}

.about__lead {
  margin: 0 0 clamp(28px, 4vw, 48px);
  font-size: clamp(24px, 2.8vw, 38px);
  font-weight: 300;
  line-height: 1.3;
  text-wrap: balance;
}

.about__lead b {
  font-weight: 500;
}

.about__columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(20px, 3vw, 48px);
  margin-bottom: clamp(40px, 6vw, 80px);
}

.about__text {
  max-width: 30em;
  margin: 0;
  color: var(--muted);
}

.about__text strong {
  color: var(--ink);
  font-weight: 500;
}

.about__education {
  margin: clamp(28px, 4vw, 48px) 0 0;
  font-size: 15.5px;
  color: var(--muted);
}

.about__education b {
  color: var(--ink);
  font-weight: 500;
}

.skills {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(16px, 2vw, 28px);
}

.skills__group {
  padding: 22px 22px 24px;
  border-top: 6px solid var(--group-color, var(--yellow));
  background: var(--panel);
}

.skills__group--yellow { --group-color: var(--yellow); }
.skills__group--red    { --group-color: var(--red); }
.skills__group--blue   { --group-color: var(--blue); }

.skills__title {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.skills__list {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 15px;
}

.skills__item {
  padding-block: 6px;
  border-top: 1px solid var(--line);
}

@media (max-width: 860px) {
  .about__columns,
  .skills {
    grid-template-columns: 1fr;
  }
}

.job {
  --job-color: var(--yellow);
  border-top: 1px solid var(--line);
}

.job--red  { --job-color: var(--red); }
.job--blue { --job-color: var(--blue); }

.job:last-of-type {
  border-bottom: 1px solid var(--line);
}

.job__summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 6px 20px;
  align-items: center;
  padding-block: 26px;
  list-style: none;
  cursor: pointer;
}

.job__summary::-webkit-details-marker {
  display: none;
}

.job__marker {
  --shape-color: var(--job-color);
  grid-row: 1 / 3;
  align-self: start;
  width: 16px;
  height: 16px;
  margin-top: 8px;
}

.job__company {
  grid-column: 2;
  margin: 0;
  font-size: clamp(22px, 2.6vw, 34px);
  font-weight: 700;
  line-height: 1.05;
  text-transform: uppercase;
  transition: color 0.3s;
}

.job__summary:hover .job__company {
  color: var(--job-color);
}

.job__title {
  grid-column: 2;
  font-size: 16px;
  color: var(--muted);
}

.job__period {
  grid-column: 3;
  grid-row: 1 / 3;
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 13px;
  letter-spacing: 0.12em;
  text-align: right;
  text-transform: uppercase;
  color: var(--muted);
}

.job__period::after {
  content: "+";
  font-size: 28px;
  font-weight: 300;
  line-height: 1;
  color: var(--ink);
  transition: transform 0.4s var(--ease);
}

.job[open] .job__period::after {
  transform: rotate(45deg);
}

.job__details {
  padding: 0 0 32px 36px;
  animation: rise 0.5s var(--ease) both;
}

.job__list {
  max-width: 44em;
  margin: 0 0 20px;
  padding: 0;
  list-style: none;
}

.job__item {
  position: relative;
  padding: 5px 0 5px 24px;
  font-size: 16.5px;
  line-height: 1.55;
  color: var(--muted);
}

.job__item::before {
  content: "";
  position: absolute;
  top: 0.95em;
  left: 0;
  width: 8px;
  height: 8px;
  background: var(--job-color);
}

.job__item b {
  color: var(--ink);
  font-weight: 500;
}

.job__tags {
  display: inline-block;
  padding: 5px 10px 5px 16px;
  background: var(--panel);
  box-shadow: inset 3px 0 var(--job-color);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

@media (max-width: 860px) {
  .job__period {
    gap: 10px;
    font-size: 12px;
  }

  .job__dates {
    display: none;
  }

  .job__details {
    padding-left: 0;
  }
}

.contact__statement {
  margin: 0 0 clamp(28px, 4vw, 48px);
  font-size: clamp(28px, 4.2vw, 56px);
  font-weight: 700;
  line-height: 1.02;
  text-transform: uppercase;
  text-wrap: balance;
}

.contact__mail {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 16px 26px;
  background: var(--yellow);
  color: var(--on-yellow);
  font-size: clamp(17px, 2.2vw, 26px);
  font-weight: 500;
  word-break: break-word;
  transition: background 0.4s, color 0.4s, transform 0.4s;
}

.contact__mail:hover {
  background: var(--red);
  color: var(--on-color);
  transform: translateX(6px);
}

.contact__links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 28px;
  margin-top: 28px;
}

.contact__link {
  padding-bottom: 4px;
  border-bottom: 2px solid var(--link-color, var(--yellow));
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  transition: border-color 0.3s;
}

.contact__link--yellow { --link-color: var(--yellow); }
.contact__link--red    { --link-color: var(--red); }

.contact__link:hover {
  border-color: var(--ink);
}

.contact__note {
  max-width: 28em;
  margin: 28px 0 0;
  color: var(--muted);
}

.ribbon {
  display: flex;
  flex-direction: column;
  margin-top: clamp(40px, 6vw, 72px);
}

.ribbon__band {
  display: block;
  height: 14px;
}

.ribbon__band--yellow { background: var(--yellow); }
.ribbon__band--red    { background: var(--red); }
.ribbon__band--blue   { background: var(--blue); }

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  padding-block: 24px 96px;
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.theme-toggle {
  position: fixed;
  right: max(16px, env(safe-area-inset-right, 0px));
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  z-index: 10;
  padding: 8px 12px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: var(--ground);
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
}

.theme-toggle:hover {
  background: var(--ink);
  color: var(--ground);
}

/* Desktop frames: on large screens each part of the page (hero, about, work,
   contact) fills one screen and the page snaps from one to the next.
   Phones and short windows scroll normally. */
@media (min-width: 861px) and (min-height: 600px) {
  html {
    scroll-snap-type: y mandatory;
    scroll-padding-top: var(--header-h);
  }

  /* each frame = the screen minus the sticky header */
  .hero,
  .section {
    min-height: calc(100svh - var(--header-h));
    scroll-snap-align: start;
  }

  .hero {
    padding-block: 16px 40px;
  }

  .section {
    align-content: center;
    padding-block: 32px 40px;
  }

  /* contact + footer together fill the last screen */
  .section--contact {
    min-height: calc(100svh - var(--header-h) - var(--footer-h));
  }

  .site-footer {
    align-items: center;
    height: var(--footer-h);
    padding-block: 0;
    padding-right: 140px; /* keeps clear of the theme toggle */
    scroll-snap-align: end;
  }

  /* narrower heading column gives the content more room */
  .section__heading {
    grid-column: 1 / 4;
    position: static;
  }

  .section__body {
    grid-column: 4 / 13;
  }

  /* hero: the mosaic never grows taller than the screen */
  .hero__mosaic {
    justify-self: end;
    width: min(100%, calc(100svh - var(--header-h) - 110px));
  }

  .mosaic {
    width: 100%;
  }

  /* about: tighter type and spacing so everything fits one screen */
  .about__lead {
    margin-bottom: clamp(16px, 3vh, 36px);
    font-size: clamp(22px, 2.4vw, 34px);
  }

  .about__columns {
    margin-bottom: clamp(20px, 4vh, 48px);
  }

  .about__text {
    font-size: 16px;
    line-height: 1.55;
  }

  .about__education {
    margin-top: clamp(16px, 3vh, 32px);
  }

  .skills__group {
    padding: 16px 18px 18px;
  }

  .skills__title {
    margin-bottom: 8px;
  }

  .skills__list {
    font-size: 14.5px;
  }

  .skills__item {
    padding-block: 4px;
  }

  /* work: the list scrolls inside its frame if it is taller than the screen */
  .jobs {
    max-height: calc(100svh - var(--header-h) - 96px);
    padding-right: 8px;
    padding-bottom: 56px; /* lets the last job scroll clear of the theme toggle */
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--line) transparent;
  }

  .job__summary {
    padding-block: clamp(12px, 2.2vh, 24px);
  }

  .job__company {
    font-size: clamp(20px, 2.2vw, 30px);
  }

  .job__title {
    font-size: 15px;
  }

  .job__details {
    padding-bottom: 20px;
  }

  .job__item {
    padding-block: 3px;
    font-size: 15.5px;
  }

  .contact__statement {
    font-size: clamp(30px, 3.6vw, 52px);
  }
}

@keyframes rise {
  from {
    opacity: 0.001;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 860px) {
  body {
    font-size: 17px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto;
  }
}
