/* Design tokens and base styles, loaded on every page. Values from the "current design" canvas. */

/* IBM Plex Mono, self-hosted. The browser loads only the subset whose characters a page uses. */
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/fonts/ibm-plex-mono-latin-400-normal.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: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/fonts/ibm-plex-mono-latin-ext-400-normal.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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/fonts/ibm-plex-mono-latin-400-italic.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: 'IBM Plex Mono';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/fonts/ibm-plex-mono-latin-ext-400-italic.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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/assets/fonts/ibm-plex-mono-latin-500-normal.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: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/assets/fonts/ibm-plex-mono-latin-ext-500-normal.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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/assets/fonts/ibm-plex-mono-latin-700-normal.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: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/assets/fonts/ibm-plex-mono-latin-ext-700-normal.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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  /* Fonts */
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;

  /* Colours, light theme */
  --color-bg: #ffffff;
  --color-text: #6b7280;
  --color-heading: #111827;
  --color-icon: #9ca3af;
  --color-dot: #d1d5db;
  --color-line: #f3f4f6;
  --color-tile: #f9fafb;
  --color-tile-border: #e5e7eb;
  --color-surface-hover: #f3f4f6;
  --color-button-bg: #111827;
  --color-button-text: #ffffff;
  --color-button-hover: #374151;
  --color-focus: #111111;

  /* Text sizes, mobile first */
  --text-hero: 3rem;
  --text-page-title: 1.875rem;
  --text-greeting: 1.125rem;
  --text-lead: 1rem;
  --text-title: 1rem;
  --text-body: 0.875rem;
  --text-small: 0.75rem;
  --text-brand: 1.125rem;

  --leading-body: 1.625;
  --leading-tight: 1.375;
  --tracking-hero: -0.025em;
  --tracking-brand: -0.02em;
  --tracking-caps: 0.1em;

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-7: 1.75rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-14: 3.5rem;
  --space-16: 4rem;
  --space-24: 6rem;

  /* Section rhythm, mobile first */
  --section-padding: var(--space-16);
  --section-label-gap: var(--space-10);
  --prose-gap: var(--space-12);

  /* Layout */
  --content-width: 64rem;
  --header-height: 4rem;
  --icon-button: 2.75rem;

  /* Shapes */
  --radius-sm: 0.5rem;
  --radius-photo: 1rem;
  --radius-pill: 9999px;

  /* Motion */
  --duration-fast: 0.15s;
  --duration-base: 0.2s;

  /* Focus ring */
  --focus-width: 2px;
  --focus-offset: 3px;
}

/* Colours, dark theme. The head script sets the class before the first paint. */
html.dark {
  --color-bg: #111111;
  --color-text: #8f8f8f;
  --color-heading: #ffffff;
  --color-icon: #8f8f8f;
  --color-dot: rgba(255, 255, 255, 0.2);
  --color-line: rgba(255, 255, 255, 0.1);
  --color-tile: rgba(255, 255, 255, 0.05);
  --color-tile-border: rgba(255, 255, 255, 0.1);
  --color-surface-hover: rgba(255, 255, 255, 0.12);
  --color-button-bg: #ffffff;
  --color-button-text: #111111;
  --color-button-hover: #e5e7eb;
  --color-focus: #ffffff;
}

/* Sizes, desktop */
@media (min-width: 768px) {
  :root {
    --text-hero: 4.5rem;
    --text-greeting: 1.25rem;
    --text-lead: 1.125rem;
    --section-padding: var(--space-24);
    --section-label-gap: var(--space-14);
    --prose-gap: var(--space-16);
    --icon-button: 2.25rem;
  }
}

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

/* The fixed header covers the top of the page, so content and anchor targets start below it. */
html {
  scroll-padding-top: var(--header-height);
}

body {
  margin: 0;
  padding-top: var(--header-height);
  font-family: var(--font-mono);
  font-size: var(--text-body);
  line-height: var(--leading-body);
  color: var(--color-text);
  background-color: var(--color-bg);
  transition: background-color var(--duration-base), color var(--duration-base);
}

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

:focus-visible {
  outline: var(--focus-width) solid var(--color-focus);
  outline-offset: var(--focus-offset);
}

/* Buttons. The primary button is a pill; in the header it is one size smaller. */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-3) var(--space-7);
  border-radius: var(--radius-pill);
  font-size: var(--text-body);
  font-weight: 700;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--color-button-text);
  background-color: var(--color-button-bg);
  transition: background-color var(--duration-fast), transform var(--duration-fast);
}

.btn-primary:hover {
  background-color: var(--color-button-hover);
}

.btn-primary:active,
.btn-icon:active {
  transform: scale(0.95);
}

.site-header .btn-primary {
  padding: var(--space-2) var(--space-5);
  font-size: var(--text-small);
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--icon-button);
  height: var(--icon-button);
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm);
  color: var(--color-icon);
  background: none;
  cursor: pointer;
  transition: color var(--duration-fast), background-color var(--duration-fast), transform var(--duration-fast);
}

.btn-icon:hover {
  color: var(--color-heading);
  background-color: var(--color-surface-hover);
}

.icon {
  width: 1rem;
  height: 1rem;
}

.menu-toggle .icon {
  width: 1.25rem;
  height: 1.25rem;
}

/* Without JavaScript the theme and menu buttons do nothing, so they are hidden. */
html:not(.js) .theme-toggle,
html:not(.js) .menu-toggle {
  display: none;
}

/* The theme button shows the sun in dark mode and the moon in light mode. */
.icon-sun,
html.dark .icon-moon,
.icon-close,
.menu-open .icon-menu {
  display: none;
}

html.dark .icon-sun,
.menu-open .icon-close {
  display: block;
}

/* Links: an underline that grows left to right on hover. */
.nav-links a:not(.btn-primary),
.footer-grid a,
.entry-org,
.legal a,
.language-link {
  position: relative;
  display: inline-block;
}

.nav-links a:not(.btn-primary)::after,
.footer-grid a::after,
.entry-org::after,
.legal a::after,
.language-link::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 0;
  height: 1px;
  background-color: currentColor;
  transition: width var(--duration-base) ease;
}

.nav-links a:not(.btn-primary):hover::after,
.footer-grid a:hover::after,
.entry-org:hover::after,
.legal a:hover::after,
.language-link:hover::after {
  width: 100%;
}

/* Header */
.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  background-color: var(--color-bg);
  box-shadow: 0 1px 0 var(--color-line);
  transition: background-color var(--duration-base);
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  max-width: var(--content-width);
  height: var(--header-height);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.brand {
  font-weight: 600;
  color: var(--color-heading);
}

.site-header .brand {
  font-size: var(--text-title);
  letter-spacing: var(--tracking-brand);
}

/* The header logo shows SEKO, and the full name on hover or keyboard focus. */
.brand-full,
.brand:hover .brand-short,
.brand:focus-visible .brand-short {
  display: none;
}

.brand:hover .brand-full,
.brand:focus-visible .brand-full {
  display: inline;
}

.nav-links {
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

/* Language link: the other language as a word, like the menu links. The padding makes it easy to tap. */
.language-link {
  margin-right: var(--space-2);
  padding: var(--space-3) 0;
}

.language-link::after {
  bottom: calc(var(--space-3) - 1px);
}

/* Mobile: the nav list opens below the header bar. Without JavaScript it stays open. */
.nav-links {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  position: absolute;
  top: var(--header-height);
  left: 0;
  right: 0;
  padding: var(--space-4) var(--space-6);
  background-color: var(--color-bg);
  border-top: 1px solid var(--color-line);
  box-shadow: 0 1px 0 var(--color-line);
}

.nav-links li a:not(.btn-primary) {
  padding: var(--space-2) 0;
}

.nav-cta {
  margin-top: var(--space-3);
}

.nav-cta .btn-primary {
  width: 100%;
  padding: var(--space-3) var(--space-5);
}

html.js .nav-links {
  display: none;
}

html.js .menu-open .nav-links {
  display: flex;
}

.nav-actions .btn-primary {
  display: none;
}

/* Desktop: the nav list sits inline, the menu button and the menu's own call button go away.
   From 1024px, because the German labels need the room. */
@media (min-width: 1024px) {
  /* Equal side columns keep the nav list in the middle of the bar, whatever the sides hold. */
  .site-nav {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: var(--space-10);
  }

  .site-nav .brand {
    justify-self: start;
  }

  .nav-actions {
    justify-self: end;
  }

  .nav-links,
  html.js .nav-links {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: var(--space-6);
    position: static;
    padding: 0;
    border: 0;
    box-shadow: none;
    background: none;
  }

  .nav-links li a:not(.btn-primary) {
    padding: 0;
  }

  .nav-actions {
    gap: var(--space-3);
  }

  .nav-cta,
  .menu-toggle {
    display: none;
  }

  .nav-actions .btn-primary {
    display: inline-flex;
  }
}

/* Footer */
.site-footer {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: var(--space-16) var(--space-6);
  border-top: 1px solid var(--color-line);
}

.footer-grid {
  display: grid;
  gap: var(--space-12);
}

.footer-grid ul {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-3);
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-footer .brand {
  font-size: var(--text-brand);
  font-weight: 700;
  letter-spacing: var(--tracking-caps);
}

/* The copyright sits under SEKO in the first column */
.footer-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-2);
}

.copyright {
  margin: 0;
  font-size: var(--text-small);
}

@media (min-width: 768px) {
  .footer-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-6);
  }

  .footer-grid nav:nth-of-type(1) ul {
    align-items: center;
  }

  .footer-grid nav:nth-of-type(2) ul {
    align-items: flex-end;
  }
}

/* Hero: the first screen, type only */
.hero {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  min-height: calc(100dvh - var(--header-height));
  max-width: var(--content-width);
  margin: 0 auto;
  padding: var(--space-24) var(--space-6);
}

/* The greeting words sit on top of each other and fade in one after another. */
.greeting {
  position: relative;
  width: 100%;
  height: 1.5em;
  margin: 0 0 var(--space-3);
  overflow: hidden;
  font-size: var(--text-greeting);
}

.greeting span {
  position: absolute;
  left: 0;
  opacity: 0;
  white-space: nowrap;
  animation: greeting 10s infinite;
}

.greeting span:nth-child(2) { animation-delay: 2s; }
.greeting span:nth-child(3) { animation-delay: 4s; }
.greeting span:nth-child(4) { animation-delay: 6s; }
.greeting span:nth-child(5) { animation-delay: 8s; }

@keyframes greeting {
  0%, 20% { opacity: 1; }
  25%, 100% { opacity: 0; }
}

.hero h1 {
  margin: 0 0 var(--space-6);
  font-size: var(--text-hero);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: var(--tracking-hero);
  color: var(--color-heading);
}

.lead {
  margin: 0 0 var(--space-10);
  font-size: var(--text-lead);
}

/* Sections below the hero */
.section {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: var(--section-padding) var(--space-6);
  border-top: 1px solid var(--color-line);
}

.section-heading {
  margin: 0 0 var(--section-label-gap);
  font-size: var(--text-body);
  font-weight: 400;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
}

.prose {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  max-width: 42rem;
  margin-bottom: var(--prose-gap);
}

.prose p {
  margin: 0;
}

/* About photos: 3:4, rounded, captioned */
.photos {
  display: grid;
  gap: var(--space-6);
}

.photos figure {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin: 0;
}

.photos img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: var(--radius-photo);
}

.photos figcaption {
  line-height: var(--leading-tight);
}

/* Experience, education and skills: date or category on the left, details on the right */
.entries {
  margin: 0;
  padding: 0;
  list-style: none;
}

.entry {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-8) 0;
  border-bottom: 1px solid var(--color-line);
}

.entry:last-child {
  border-bottom: 0;
}

.entry-when {
  margin: 0;
}

.entry-when span {
  display: block;
  margin-top: var(--space-1);
  font-size: var(--text-small);
}

.entry-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-1);
  margin-bottom: var(--space-3);
}

.entry-dot {
  margin: 0 var(--space-1);
  color: var(--color-dot);
}

.entry-title {
  margin: 0;
  font-size: var(--text-title);
  font-weight: 500;
  color: var(--color-heading);
}

.entry-text {
  margin: 0;
}

.entry-sub {
  margin: var(--space-1) 0 0;
}

/* Skills: one tile per tool, two per row on phones, three from 768px */
.skill-tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
  margin: 0;
  padding: 0;
  list-style: none;
}

.skill-tiles li {
  padding: var(--space-2) var(--space-4);
  border: 1px solid var(--color-tile-border);
  border-radius: var(--radius-sm);
  font-weight: 500;
  color: var(--color-heading);
  background-color: var(--color-tile);
}

@media (min-width: 768px) {
  .skill-tiles {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Legal pages: one narrow column of text, a back link on top */
.legal {
  max-width: 42rem;
  min-height: calc(100dvh - var(--header-height));
  margin: 0 auto;
  padding: var(--section-padding) var(--space-6);
}

.back-link {
  margin-bottom: var(--space-12);
}

.legal h1 {
  margin: 0 0 var(--space-8);
  font-size: var(--text-page-title);
  font-weight: 700;
  letter-spacing: var(--tracking-hero);
  color: var(--color-heading);
}

.legal section {
  margin-top: var(--space-8);
}

.legal h2 {
  margin: 0 0 var(--space-2);
  font-size: var(--text-body);
  font-weight: 500;
  color: var(--color-heading);
}

.legal p {
  margin: 0;
}

.legal p + p,
.legal ul,
.legal ul + p {
  margin-top: var(--space-2);
}

.legal ul {
  margin-bottom: 0;
  padding-left: var(--space-5);
}

.legal li + li {
  margin-top: var(--space-1);
}

.legal .updated {
  margin-top: var(--space-8);
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-line);
  font-size: var(--text-small);
}

@media (min-width: 768px) {
  .photos {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .entry {
    grid-template-columns: 10rem 1fr;
    gap: var(--space-8);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0s !important;
  }

  .greeting span {
    animation: none;
  }

  .greeting span:first-child {
    opacity: 1;
  }
}
