@font-face {
  font-family: "Familjen Grotesk";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("fonts/familjen-grotesk-latin-ext.woff2") format("woff2");
  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: "Familjen Grotesk";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("fonts/familjen-grotesk-latin.woff2") format("woff2");
  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";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/jetbrains-mono-latin-ext.woff2") format("woff2");
  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";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/jetbrains-mono-latin.woff2") format("woff2");
  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;
}

:root {
  --color-bg: #0f1519;
  --color-text: #e4e8ea;
  --color-text-strong: #ffffff;
  --color-text-soft: #b9c3c9;
  --color-text-muted: #93a0a8;
  --color-accent: #c9a36a;
  --color-rule: #2a3842;
  --color-rule-soft: #1f2a32;
  --color-link-rule: #3a4c58;
  --color-contour: #1f2a32;
  --color-contour-accent: #3a4c58;
  --color-bar: rgb(15 21 25 / 0.62);

  --font-sans: "Familjen Grotesk", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  --ease-panel: cubic-bezier(0.2, 0.7, 0.2, 1);
  --contour-dash: 2600;
  --contour-draw-duration: 3.2s;
  --contour-shift: -38px;

  color-scheme: dark;
}

:root[data-depth="1"] {
  --color-bg: #0d1317;
  --color-contour-accent: #3d505d;
}

:root[data-depth="2"] {
  --color-bg: #0b1115;
  --color-contour-accent: #415663;
}

:root[data-depth="3"] {
  --color-bg: #090e12;
  --color-contour-accent: #465c6a;
}

:root[data-depth="4"] {
  --color-bg: #070b0e;
  --color-contour-accent: #4c6372;
}

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

html {
  background-color: var(--color-bg);
  transition: background-color 1.6s ease;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  color: var(--color-text);
  font-family: var(--font-sans);
}

h1,
h2,
p,
ol,
ul,
dl,
dd {
  margin: 0;
}

a {
  color: var(--color-text);
}

a:hover {
  color: var(--color-accent);
}

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

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.mono {
  font-family: var(--font-mono);
}

/* Background contours */

.contours {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.contours-depth {
  transform: translateY(calc(var(--depth, 0) * var(--contour-shift)));
  transition: transform 1.8s cubic-bezier(0.3, 0.6, 0.2, 1);
}

.contours-drift {
  animation: contours-drift 48s ease-in-out infinite alternate;
}

.contour {
  stroke: var(--color-contour);
  stroke-dasharray: var(--contour-dash);
  stroke-dashoffset: var(--contour-dash);
  animation: contour-draw var(--contour-draw-duration) cubic-bezier(0.4, 0, 0.2, 1) forwards;
  transition: stroke 1.4s ease;
}

.contour-accent {
  stroke: var(--color-contour-accent);
}

@keyframes contour-draw {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes contours-drift {
  from {
    transform: translate(-24px, 0);
  }

  to {
    transform: translate(24px, -10px);
  }
}

/* Page layout */

.page {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 36px clamp(20px, 3.4vw, 48px);
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--color-text-muted);
}

.language {
  display: flex;
  align-items: center;
}

.language a {
  min-height: 44px;
  min-width: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  text-decoration: none;
}

.language a[aria-current="page"] {
  color: var(--color-text);
}

.language a:hover {
  color: var(--color-accent);
}

.content {
  flex: 1 1 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 56px clamp(40px, 7vw, 120px);
}

/* Introduction */

.intro {
  flex: 1 1 480px;
  max-width: 640px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  opacity: 0;
  transform: translateY(8px);
  animation: intro-in 1s ease 0.6s forwards;
}

@keyframes intro-in {
  to {
    opacity: 1;
    transform: none;
  }
}

.intro-role {
  font-size: 16px;
  color: var(--color-accent);
}

.intro-name {
  font-size: clamp(60px, 7.6vw, 116px);
  line-height: 0.94;
  letter-spacing: -0.035em;
  font-weight: 500;
}

.intro-lead {
  max-width: 32ch;
  font-size: 22px;
  line-height: 1.5;
  color: var(--color-text-soft);
}

/* Sections */

.sections {
  flex: 1 1 420px;
  max-width: 560px;
  border-top: 1px solid var(--color-rule);
}

.section {
  border-bottom: 1px solid var(--color-rule);
}

.section-heading {
  font: inherit;
}

.section-toggle {
  width: 100%;
  min-height: 72px;
  padding: 22px 0;
  display: flex;
  align-items: center;
  gap: 20px;
  border: 0;
  background: none;
  font: inherit;
  color: var(--color-text);
  text-align: left;
  cursor: pointer;
}

.section-title {
  font-size: 30px;
  font-weight: 500;
  letter-spacing: -0.02em;
  transition: color 0.2s ease;
}

.section-toggle:hover .section-title {
  color: var(--color-text-strong);
}

.section-icon {
  position: relative;
  width: 18px;
  height: 18px;
  margin-left: auto;
  flex: none;
  transition: transform 0.45s var(--ease-panel);
}

.section-icon::before,
.section-icon::after {
  content: "";
  position: absolute;
  inset: 50% 0 auto;
  height: 1px;
  background: currentColor;
}

.section-icon::after {
  transform: rotate(90deg);
}

.section-toggle[aria-expanded="true"] .section-icon {
  transform: rotate(45deg);
}

.section-panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.55s var(--ease-panel);
}

.section-panel-inner {
  overflow: hidden;
  visibility: hidden;
  transition: visibility 0s 0.55s;
}

.section.is-open .section-panel {
  grid-template-rows: 1fr;
}

.section.is-open .section-panel-inner {
  visibility: visible;
  transition: none;
}

.prose {
  padding-bottom: 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  font-size: 17px;
  line-height: 1.65;
  color: var(--color-text-soft);
}

/* Experience */

.jobs {
  list-style: none;
  padding: 0 0 24px;
}

.job {
  padding: 10px 0;
  display: flex;
  align-items: baseline;
  border-top: 1px solid var(--color-rule-soft);
}

.job-role {
  font-size: 16px;
}

.job-meta {
  display: contents;
}

.job-company {
  color: var(--color-text-muted);
}

.job-company::before {
  content: "\00a0· ";
}

.job-years {
  margin-left: auto;
  padding-left: 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--color-text-muted);
  white-space: nowrap;
}

.job-earlier {
  color: var(--color-text-muted);
}

.job-century,
.job-present {
  display: none;
}

/* Tech stack */

.stack {
  padding-bottom: 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.stack-group {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
}

.stack-group dt {
  flex: 0 0 150px;
  padding-top: 3px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--color-text-muted);
}

.stack-group dd {
  flex: 1 1 240px;
  font-size: 16px;
  line-height: 1.55;
}

.copyright {
  display: none;
}

/* Footer */

.bottom-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px 48px;
}

.contact {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 36px;
  font-size: 16px;
}

.contact a {
  padding-bottom: 3px;
  border-bottom: 1px solid var(--color-link-rule);
  text-decoration: none;
  transition: border-color 0.2s ease;
}

.contact a:hover {
  border-bottom-color: var(--color-accent);
}

.clock {
  display: flex;
  align-items: baseline;
  gap: 14px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--color-text-muted);
}

.clock[hidden] {
  display: none;
}

.clock-time {
  font-size: 22px;
  color: var(--color-text);
  font-variant-numeric: tabular-nums;
}

.clock-colon {
  animation: clock-blink 2s steps(1) infinite;
}

@keyframes clock-blink {
  50% {
    opacity: 0.3;
  }
}

/* Phone */

@media (width < 48rem) {
  :root {
    --contour-dash: 900;
    --contour-draw-duration: 3s;
    --contour-shift: -24px;
  }

  .contours-drift {
    animation-name: contours-drift-narrow;
    animation-duration: 40s;
  }

  @keyframes contours-drift-narrow {
    from {
      transform: translate(-10px, 0);
    }

    to {
      transform: translate(10px, -6px);
    }
  }

  .page {
    display: block;
    padding: 0;
  }

  .top-bar,
  .bottom-bar {
    position: fixed;
    left: 0;
    right: 0;
    z-index: 2;
    background: var(--color-bar);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    padding-inline: max(20px, env(safe-area-inset-left)) max(20px, env(safe-area-inset-right));
  }

  .top-bar {
    top: 0;
    padding-block: max(4px, env(safe-area-inset-top)) 4px;
    font-size: 12px;
  }

  .language a {
    min-width: 44px;
  }

  .language a[aria-current="page"],
  .language-separator {
    display: none;
  }

  .content {
    display: block;
    padding: 52px 20px 64px;
  }

  .intro {
    min-height: 400px;
    max-width: none;
    padding: 40px 0 44px;
    justify-content: flex-end;
    gap: 18px;
    opacity: 1;
    transform: none;
    animation: none;
  }

  .intro-role {
    font-size: 15px;
  }

  .intro-name {
    font-size: 68px;
  }

  .intro-name-part {
    display: block;
  }

  .intro-lead {
    max-width: none;
    font-size: 18px;
  }

  .sections {
    max-width: none;
  }

  .section-toggle {
    min-height: 64px;
    padding: 18px 0;
    gap: 16px;
    cursor: default;
  }

  .section-title {
    font-size: 24px;
  }

  .section-toggle:hover .section-title {
    color: inherit;
  }

  .section-icon {
    width: 16px;
    height: 16px;
  }

  .prose {
    padding-bottom: 24px;
    gap: 12px;
    font-size: 16px;
  }

  .jobs {
    padding-bottom: 20px;
  }

  .job {
    flex-direction: column;
    gap: 2px;
  }

  .job-role {
    font-size: 15px;
  }

  .job-meta {
    display: block;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--color-text-muted);
  }

  .job-company::before {
    content: none;
  }

  .job-company::after {
    content: " · ";
  }

  .job-years {
    margin-left: 0;
    padding-left: 0;
    font-size: inherit;
  }

  .job-century,
  .job-present {
    display: inline;
  }

  .stack {
    padding-bottom: 24px;
  }

  .stack-group {
    display: block;
  }

  .stack-group dt {
    margin-bottom: 4px;
    padding-top: 0;
    font-size: 11px;
  }

  .stack-group dd {
    font-size: 15px;
  }

  .copyright {
    display: block;
    margin: 40px 0 24px;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--color-text-muted);
  }

  .bottom-bar {
    bottom: 0;
    padding-block: 4px max(12px, env(safe-area-inset-bottom));
    flex-wrap: nowrap;
    align-items: center;
    gap: 16px;
  }

  .contact {
    flex-wrap: nowrap;
    gap: 16px;
    font-size: 14px;
  }

  .contact a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    padding-bottom: 0;
    border-bottom: 0;
    text-decoration: underline;
  }

  .clock-city {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .clock-time {
    font-size: 13px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html,
  .contours-depth,
  .contour,
  .section-icon,
  .section-panel,
  .section-panel-inner,
  .section-title {
    transition: none;
  }

  .contour {
    animation: none;
    stroke-dashoffset: 0;
  }

  .contours-drift,
  .clock-colon {
    animation: none;
  }

  .intro {
    opacity: 1;
    transform: none;
    animation: none;
  }
}
