/* ==========================================================
   Ayaz Ata Türkmen, portfolio.
   Allcess design tokens with a technical skin: IBM Plex Mono for
   headings and interface text, a blueprint grid, framed panels.
   On computers every page fits one screen; phones scroll normally.
   ========================================================== */

@font-face { font-family: "Plex Sans"; src: url("../fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Plex Sans"; src: url("../fonts/ibm-plex-sans-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Plex Sans"; src: url("../fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Plex Sans Ext"; src: url("../fonts/ibm-plex-sans-latin-ext-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Plex Sans Ext"; src: url("../fonts/ibm-plex-sans-latin-ext-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Plex Sans Ext"; src: url("../fonts/ibm-plex-sans-latin-ext-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url("../fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url("../fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }

/* ---------- Tokens ---------- */
:root {
  color-scheme: light;

  --canvas: 255 255 255;
  --surface: 255 255 255;
  --clay: 241 243 246;
  --line: 222 226 231;
  --line-strong: 160 168 177;
  --ink: 21 24 28;
  --grid: 21 24 28;

  --rust: 255 90 31;
  --rust-deep: 194 65 12;
  --rust-deeper: 154 51 9;
  --accent: 204 68 16;
  --ok: 21 128 61;

  --sans: "Plex Sans", "Plex Sans Ext", system-ui, -apple-system, sans-serif;
  --mono: "Plex Mono", "Plex Sans Ext", ui-monospace, SFMono-Regular, Menlo, monospace;

  --shadow-sm: 0 1px 2px 0 rgb(16 24 40 / 0.04);
  --shadow-md: 0 6px 16px -4px rgb(16 24 40 / 0.1), 0 2px 4px -2px rgb(16 24 40 / 0.05);
  --page: 76rem;
  --header: 3.5rem;
  --radius: 4px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

.dark {
  color-scheme: dark;

  --canvas: 14 17 21;
  --surface: 24 28 34;
  --clay: 34 40 47;
  --line: 44 51 59;
  --line-strong: 82 92 103;
  --ink: 231 234 238;
  --grid: 231 234 238;

  --rust-deep: 255 139 77;
  --rust-deeper: 255 168 117;
  --ok: 93 211 158;
}

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

html {
  scroll-behavior: smooth;
  text-rendering: optimizeLegibility;
  background: rgb(var(--canvas));
}

body {
  position: relative;
  min-height: 100vh;
  margin: 0;
  background: rgb(var(--canvas));
  color: rgb(var(--ink));
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.5rem;
  font-feature-settings: "kern", "liga";
  -webkit-font-smoothing: antialiased;
  isolation: isolate;
}

/* blueprint grid: fine lines every 24px, stronger every 120px */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgb(var(--grid) / 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgb(var(--grid) / 0.055) 1px, transparent 1px),
    linear-gradient(rgb(var(--grid) / 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgb(var(--grid) / 0.03) 1px, transparent 1px);
  background-size: 120px 120px, 120px 120px, 24px 24px, 24px 24px;
  background-position: center top;
  -webkit-mask-image: radial-gradient(ellipse 85% 80% at 50% 45%, #000 30%, transparent 100%);
  mask-image: radial-gradient(ellipse 85% 80% at 50% 45%, #000 30%, transparent 100%);
}

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

:focus-visible {
  outline: 2px solid rgb(var(--rust-deep));
  outline-offset: 2px;
  border-radius: var(--radius);
}

::selection {
  background: rgb(var(--rust) / 0.3);
}

.icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

main {
  width: 100%;
  max-width: var(--page);
  margin: 0 auto;
  padding: 2.5rem 2rem 4rem;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  flex-shrink: 0;
  border-bottom: 1px solid rgb(var(--line));
  background: rgb(var(--canvas) / 0.86);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.bar {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: var(--page);
  height: var(--header);
  margin: 0 auto;
  padding: 0 2rem;
}

.logo {
  border-radius: var(--radius);
  font-family: var(--mono);
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.site-header nav {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
  font-family: var(--mono);
  font-size: 0.8125rem;
}

.site-header nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 12px;
  border-radius: var(--radius);
  color: rgb(var(--ink) / 0.65);
  transition: background-color 150ms, color 150ms;
}

.site-header nav a:hover {
  background: rgb(var(--clay));
  color: rgb(var(--ink));
}

.site-header nav a[aria-current="page"] {
  color: rgb(var(--ink));
}

.nav-indicator {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: calc((var(--header) - 32px) / -2 - 1px);
  height: 2px;
  background: rgb(var(--rust));
}

.menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin-left: auto;
  padding: 0;
  border: 1px solid rgb(var(--line));
  border-radius: var(--radius);
  background: rgb(var(--surface));
  color: rgb(var(--ink));
  cursor: pointer;
}

.menu-toggle .icon {
  width: 18px;
  height: 18px;
}

.menu-toggle .icon-close,
.menu-toggle[aria-expanded="true"] .icon-menu {
  display: none;
}

.menu-toggle[aria-expanded="true"] .icon-close {
  display: block;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: rgb(var(--ink) / 0.75);
  cursor: pointer;
  transition: background-color 150ms, color 150ms, border-color 150ms;
}

.theme-toggle:hover {
  border-color: rgb(var(--line));
  background: rgb(var(--clay));
  color: rgb(var(--ink));
}

.theme-toggle .icon {
  width: 17px;
  height: 17px;
}

.theme-toggle .icon-sun,
.dark .theme-toggle .icon-moon {
  display: none;
}

.dark .theme-toggle .icon-sun {
  display: block;
}

/* ---------- Type ---------- */
h1 {
  margin: 0;
  font-family: var(--mono);
  font-size: 2rem;
  line-height: 2.5rem;
  letter-spacing: -0.03em;
  font-weight: 500;
}

.prose {
  max-width: 40rem;
}

.prose > p {
  margin: 0.75rem 0 0;
  font-size: 1rem;
  line-height: 1.625rem;
  color: rgb(var(--ink) / 0.72);
}

/* ---------- Panels (shared) ---------- */
.panel-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  height: 40px;
  padding: 0 14px;
  border-bottom: 1px solid rgb(var(--line));
  background: rgb(var(--clay) / 0.55);
}

.panel-bar h2 {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.8125rem;
  line-height: 1rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.idx {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: rgb(var(--rust-deep));
}

/* ---------- Home ---------- */
.home-toggle {
  position: fixed;
  top: 18px;
  right: 22px;
  z-index: 10;
}

.hud {
  position: fixed;
  inset: 16px;
  z-index: 0;
  pointer-events: none;
}

.corner {
  position: absolute;
  width: 18px;
  height: 18px;
  border-color: rgb(var(--ink) / 0.35);
  border-style: solid;
  border-width: 0;
}

.corner.tl { top: 0; left: 0; border-top-width: 1.5px; border-left-width: 1.5px; }
.corner.tr { top: 0; right: 0; border-top-width: 1.5px; border-right-width: 1.5px; }
.corner.bl { bottom: 0; left: 0; border-bottom-width: 1.5px; border-left-width: 1.5px; }
.corner.br { bottom: 0; right: 0; border-bottom-width: 1.5px; border-right-width: 1.5px; }

.hud-text {
  position: absolute;
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.04em;
  color: rgb(var(--ink) / 0.5);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.hud-tl { top: 4px; left: 28px; }
.hud-bl { bottom: 4px; left: 28px; }

.hero {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  max-width: none;
  padding: 4rem 1rem;
  text-align: center;
}

.hero h1 {
  font-size: clamp(2.25rem, 5.4vw, 4.25rem);
  line-height: 1.1;
  letter-spacing: -0.045em;
}

.tagline {
  display: inline-flex;
  align-items: center;
  margin: 1.25rem 0 0;
  font-family: var(--mono);
  font-size: 0.9375rem;
  color: rgb(var(--ink) / 0.6);
}

.caret {
  display: inline-block;
  width: 0.55em;
  height: 1.15em;
  margin-left: 4px;
  background: rgb(var(--rust));
}

.hero-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 2.75rem;
}

.hero-links a {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: 42px;
  padding: 0 18px 0 14px;
  border: 1px solid rgb(var(--line-strong) / 0.75);
  border-radius: var(--radius);
  background: rgb(var(--surface));
  box-shadow: var(--shadow-sm);
  font-family: var(--mono);
  font-size: 0.875rem;
  font-weight: 500;
  transition: border-color 150ms, color 150ms, transform 200ms var(--ease);
}

.hero-links a .icon {
  width: 16px;
  height: 16px;
  color: rgb(var(--ink) / 0.5);
  transition: color 150ms;
}

.dot-slash {
  color: rgb(var(--ink) / 0.4);
  transition: color 150ms;
}

.hero-links a:hover {
  border-color: rgb(var(--rust) / 0.7);
}

.hero-links a:hover .icon,
.hero-links a:hover .dot-slash {
  color: rgb(var(--rust-deep));
}

/* ---------- About ---------- */
.about-intro {
  max-width: 54rem;
}

.hobbies {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: minmax(min-content, 1fr);
  gap: 14px;
  margin-top: 1.75rem;
}

.hobby {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  border: 1px solid rgb(var(--line));
  border-radius: var(--radius);
  background: rgb(var(--surface));
  box-shadow: var(--shadow-sm);
  scroll-margin-top: calc(var(--header) + 1rem);
}

.hobby p {
  margin: 0;
  padding: 2px 14px 16px;
  font-size: 0.875rem;
  line-height: 1.375rem;
  color: rgb(var(--ink) / 0.74);
}

.placeholder {
  position: relative;
  flex: 1;
  min-height: 96px;
  margin: 12px;
}

.placeholder img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 120px;
  object-fit: cover;
  border-radius: 2px;
}

/* empty image slot: crop marks, a fine grid and a label */
.placeholder-box {
  --tick: rgb(var(--rust));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 100%;
  min-height: 120px;
  aspect-ratio: auto;
  color: rgb(var(--ink) / 0.45);
  background:
    linear-gradient(var(--tick), var(--tick)) top left / 14px 1.5px no-repeat,
    linear-gradient(var(--tick), var(--tick)) top left / 1.5px 14px no-repeat,
    linear-gradient(var(--tick), var(--tick)) top right / 14px 1.5px no-repeat,
    linear-gradient(var(--tick), var(--tick)) top right / 1.5px 14px no-repeat,
    linear-gradient(var(--tick), var(--tick)) bottom left / 14px 1.5px no-repeat,
    linear-gradient(var(--tick), var(--tick)) bottom left / 1.5px 14px no-repeat,
    linear-gradient(var(--tick), var(--tick)) bottom right / 14px 1.5px no-repeat,
    linear-gradient(var(--tick), var(--tick)) bottom right / 1.5px 14px no-repeat,
    linear-gradient(rgb(var(--grid) / 0.06) 1px, transparent 1px) 0 0 / 12px 12px,
    linear-gradient(90deg, rgb(var(--grid) / 0.06) 1px, transparent 1px) 0 0 / 12px 12px,
    rgb(var(--clay) / 0.5);
}

.placeholder-box .icon {
  width: 28px;
  height: 28px;
  stroke-width: 1.5;
}

.placeholder-box span {
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.02em;
}

/* ---------- Projects ---------- */

.page-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.meta {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: rgb(var(--ink) / 0.55);
}

.board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 1.5rem;
}

.column {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border: 1px solid rgb(var(--line));
  border-radius: var(--radius);
  background: rgb(var(--clay) / 0.35);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.column-icon {
  display: inline-flex;
  color: rgb(var(--ink) / 0.55);
}

.column-icon .icon {
  width: 15px;
  height: 15px;
}

.count {
  margin-left: auto;
  min-width: 26px;
  padding: 1px 7px;
  border: 1px solid rgb(var(--line));
  border-radius: 2px;
  background: rgb(var(--surface));
  font-family: var(--mono);
  font-size: 0.6875rem;
  line-height: 1rem;
  text-align: center;
  color: rgb(var(--ink) / 0.7);
}

.column-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  min-height: 0;
  padding: 12px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgb(var(--line-strong)) transparent;
  border-radius: 0;
}

.column-body:focus-visible {
  outline-offset: -2px;
}

.pcard {
  flex-shrink: 0;
  overflow: hidden;
  border: 1px solid rgb(var(--line));
  border-radius: var(--radius);
  background: rgb(var(--surface));
  transition: border-color 150ms, transform 200ms var(--ease), box-shadow 200ms;
}

.pcard:hover {
  border-color: rgb(var(--line-strong));
}

.pcard img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 8;
  object-fit: cover;
  border-bottom: 1px solid rgb(var(--line));
  background: rgb(var(--clay));
}

.pcard-body {
  padding: 14px 16px 16px;
}

.badges {
  display: flex;
  align-items: center;
  gap: 6px;
}

.pcard.is-focus {
  border-color: rgb(var(--rust) / 0.55);
}

.focus {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 7px;
  border-radius: 2px;
  background: rgb(var(--rust));
  font-family: var(--mono);
  font-size: 0.6875rem;
  line-height: 1rem;
  font-weight: 500;
  color: #15181c;
  white-space: nowrap;
}

.focus .icon {
  width: 11px;
  height: 11px;
  stroke-width: 2.2;
}

.pcard-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.pcard h3 {
  margin: 0;
  font-family: var(--mono);
  font-size: 1rem;
  line-height: 1.5rem;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 1px 8px;
  border: 1px solid currentColor;
  border-radius: 2px;
  font-family: var(--mono);
  font-size: 0.6875rem;
  line-height: 1rem;
  white-space: nowrap;
}

.status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.status-live {
  color: rgb(var(--ok));
  border-color: rgb(var(--ok) / 0.35);
  background: rgb(var(--ok) / 0.08);
}

.status-archived {
  color: rgb(var(--ink) / 0.55);
  border-color: rgb(var(--line-strong) / 0.6);
}

.pcard-date {
  margin: 2px 0 10px;
  font-family: var(--mono);
  font-size: 0.71875rem;
  color: rgb(var(--ink) / 0.55);
  font-variant-numeric: tabular-nums;
}

.pcard-desc {
  margin: 0;
  font-size: 0.84375rem;
  line-height: 1.375rem;
  color: rgb(var(--ink) / 0.74);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.chips li {
  padding: 1px 7px;
  border: 1px solid rgb(var(--line));
  border-radius: 2px;
  background: rgb(var(--clay) / 0.6);
  font-family: var(--mono);
  font-size: 0.6875rem;
  line-height: 1.125rem;
  color: rgb(var(--ink) / 0.8);
}

.pcard-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin-top: 12px;
}

.pcard-links a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--mono);
  font-size: 0.78125rem;
  font-weight: 500;
  color: rgb(var(--rust-deep));
  transition: color 150ms;
}

.pcard-links a:hover {
  color: rgb(var(--rust-deeper));
}

.pcard-links .icon {
  width: 13px;
  height: 13px;
}

.pcard-note {
  margin: 12px 0 0;
  padding-left: 10px;
  border-left: 2px solid rgb(var(--line-strong) / 0.6);
  font-size: 0.75rem;
  line-height: 1.125rem;
  color: rgb(var(--ink) / 0.6);
}

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  padding: 2rem 1.5rem;
  text-align: center;
}

.empty-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  border: 1.5px dashed rgb(var(--line-strong));
  border-radius: 50%;
  color: rgb(var(--ink) / 0.5);
}

.empty-icon .icon {
  width: 24px;
  height: 24px;
  stroke-width: 1.7;
}

.empty h3 {
  margin: 14px 0 4px;
  font-family: var(--mono);
  font-size: 0.875rem;
  font-weight: 500;
}

.empty p {
  max-width: 21rem;
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.25rem;
  color: rgb(var(--ink) / 0.6);
}

/* ---------- Contact ---------- */
main.split {
  display: grid;
  grid-template-columns: 5fr 6fr;
  gap: 4rem;
  align-items: center;
}

.contact {
  list-style: none;
  max-width: 34rem;
  margin: 2rem 0 0;
  padding: 0;
  border: 1px solid rgb(var(--line));
  border-radius: var(--radius);
  background: rgb(var(--surface));
  box-shadow: var(--shadow-sm);
}

.contact li {
  padding: 16px 20px;
}

.contact li + li {
  border-top: 1px solid rgb(var(--line));
}

.label {
  display: block;
  margin-bottom: 3px;
  font-family: var(--mono);
  font-size: 0.6875rem;
  line-height: 1rem;
  color: rgb(var(--ink) / 0.55);
}

.contact a {
  font-family: var(--mono);
  font-size: 0.9375rem;
  font-weight: 500;
  color: rgb(var(--rust-deep));
  transition: color 150ms;
}

.contact a:hover {
  color: rgb(var(--rust-deeper));
}

.illustration {
  margin: 0;
}

.illustration svg {
  display: block;
  width: 100%;
  max-height: 60vh;
  height: auto;
}

.illustration .i-frame { fill: rgb(var(--surface)); stroke: rgb(var(--line-strong) / 0.7); stroke-width: 1.5; }
.illustration .i-line { fill: none; stroke: rgb(var(--ink) / 0.4); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.illustration .i-dash { stroke-dasharray: 4 7; }
.illustration .i-soft { fill: rgb(var(--clay)); }
.illustration .i-accent { fill: rgb(var(--rust)); }
.illustration .i-accent-dark { fill: rgb(var(--accent)); }

/* ==========================================================
   One screen on computers: the header sits on top and the page
   fills the rest of the window, with no page scroll.
   ========================================================== */
@media (min-width: 1024px) and (min-height: 560px) {
  body.page {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
  }

  body.page main {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    padding: clamp(1.25rem, 3.5vh, 2.25rem) 2rem clamp(1.25rem, 3.5vh, 2rem);
    overflow: auto; /* only kicks in on unusually short windows */
  }

  .hobbies,
  .board {
    flex: 1;
    min-height: 0;
  }

  .hobbies {
    margin-top: clamp(1rem, 3vh, 1.75rem);
  }

  .board {
    margin-top: clamp(0.875rem, 2.5vh, 1.5rem);
  }

  body.page main.split {
    display: grid;
    align-content: center;
  }
}

/* taller screens: a 2 x 2 grid, each photo beside its text */
@media (min-width: 1024px) and (min-height: 740px) {
  .hobbies {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(2, minmax(min-content, 1fr));
  }

  .hobby {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
  }

  .hobby .panel-bar {
    grid-column: 1 / -1;
  }

  .hobby .placeholder {
    min-height: 0;
    margin: 14px 0 14px 14px;
  }

  .hobby p {
    align-self: center;
    padding: 14px 18px;
    font-size: 0.9375rem;
    line-height: 1.5rem;
  }
}

/* ---------- Smaller screens: normal scrolling ---------- */
@media (max-width: 1023px), (max-height: 559px) {
  .hobbies {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: auto;
  }

  .placeholder {
    flex: none;
    min-height: 0;
  }

  .placeholder-box,
  .placeholder img {
    aspect-ratio: 16 / 10;
    height: auto;
  }

  .board {
    grid-template-columns: 1fr;
  }

  .column-body {
    max-height: 36rem;
  }

  .empty {
    min-height: 13rem;
  }
}

@media (max-width: 900px) {
  main.split {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .illustration {
    max-width: 32rem;
  }
}

@media (max-width: 640px) {
  .bar {
    gap: 2px;
    padding: 0 1rem;
  }

  main {
    padding: 1.75rem 1rem 3.5rem;
  }

  .logo {
    font-size: 0.8125rem;
  }

  .menu-toggle {
    display: inline-flex;
  }

  .bar {
    gap: 8px;
  }

  .site-header nav {
    position: absolute;
    top: calc(100% + 6px);
    right: 1rem;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    min-width: 12rem;
    margin: 0;
    padding: 6px;
    border: 1px solid rgb(var(--line));
    border-radius: var(--radius);
    background: rgb(var(--surface));
    box-shadow: var(--shadow-md);
    font-size: 0.875rem;
  }

  .site-header nav.open {
    display: flex;
  }

  .site-header nav a {
    height: 40px;
    padding: 0 14px;
  }

  .site-header nav a[aria-current="page"] {
    background: rgb(var(--clay) / 0.7);
  }

  .nav-indicator {
    left: 0;
    right: auto;
    top: 9px;
    bottom: 9px;
    width: 2px;
    height: auto;
  }


  .hobbies {
    grid-template-columns: 1fr;
  }

  .hud-text {
    font-size: 0.625rem;
  }

  .hero-links a {
    height: 40px;
    padding: 0 14px 0 12px;
  }
}

/* ==========================================================
   Motion
   ========================================================== */
@view-transition {
  navigation: auto;
}

.site-header { view-transition-name: site-header; }
.logo,
.hero h1 { view-transition-name: site-name; }
.nav-indicator { view-transition-name: nav-indicator; }
.theme-toggle { view-transition-name: theme-toggle; }
main { view-transition-name: page; }

.logo,
.hero h1 {
  width: fit-content;
}

::view-transition-group(*) {
  animation-duration: 480ms;
  animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
}

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 300ms;
}

::view-transition-old(page) {
  animation: vt-page-out 200ms cubic-bezier(0.4, 0, 1, 1) both;
}

::view-transition-new(page) {
  animation: vt-page-in 520ms var(--ease) 90ms both;
}

::view-transition-new(site-header):only-child {
  animation: vt-header-in 480ms var(--ease) both;
}

::view-transition-old(site-header):only-child {
  animation: vt-header-out 240ms cubic-bezier(0.4, 0, 1, 1) both;
}

::view-transition-new(nav-indicator):only-child {
  animation: vt-grow 420ms var(--ease) 120ms both;
}

@keyframes vt-page-out { to { opacity: 0; transform: translateY(-10px); } }
@keyframes vt-page-in { from { opacity: 0; transform: translateY(22px); } }
@keyframes vt-header-in { from { opacity: 0; transform: translateY(-100%); } }
@keyframes vt-header-out { to { opacity: 0; transform: translateY(-100%); } }
@keyframes vt-grow { from { transform: scaleX(0); } }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } }
@keyframes fade { from { opacity: 0; } }

@media (prefers-reduced-motion: no-preference) {
  html,
  body {
    transition: background-color 200ms ease, color 200ms ease;
  }

  /* fallback for browsers without view transitions */
  html.js:not(.vt) main {
    animation: rise 520ms var(--ease) both;
  }

  body.is-leaving main,
  body.is-leaving .site-header nav {
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 180ms ease-in, transform 180ms ease-in;
  }

  .site-header nav.open {
    animation: menu-in 200ms var(--ease) both;
  }

  @keyframes menu-in {
    from { opacity: 0; transform: translateY(-6px); }
  }

  /* home */
  .caret {
    animation: blink 1.1s steps(1) infinite;
  }

  @keyframes blink {
    50% { opacity: 0; }
  }

  .tagline {
    animation: rise 600ms var(--ease) 180ms both;
  }

  .hero-links a {
    animation: rise 600ms var(--ease) both;
  }

  .hero-links a:nth-child(1) { animation-delay: 300ms; }
  .hero-links a:nth-child(2) { animation-delay: 380ms; }
  .hero-links a:nth-child(3) { animation-delay: 460ms; }

  .hero-links a:hover {
    transform: translateY(-2px);
  }

  .hud {
    animation: fade 900ms ease 200ms both;
  }

  .corner {
    animation: corner-in 700ms var(--ease) 150ms both;
  }

  @keyframes corner-in {
    from { opacity: 0; transform: scale(2.2); }
  }

  .corner.tl { transform-origin: top left; }
  .corner.tr { transform-origin: top right; }
  .corner.bl { transform-origin: bottom left; }
  .corner.br { transform-origin: bottom right; }

  body.home::before {
    animation: fade 1200ms ease both;
  }

  /* about: panels come in one after another */
  html.js [data-reveal] {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 600ms var(--ease), transform 600ms var(--ease);
  }

  html.js [data-reveal].is-visible {
    opacity: 1;
    transform: none;
  }

  .hobby:nth-child(2) { transition-delay: 70ms; }
  .hobby:nth-child(3) { transition-delay: 140ms; }
  .hobby:nth-child(4) { transition-delay: 210ms; }

  /* projects */
  .column {
    animation: rise 600ms var(--ease) both;
  }

  .column:nth-child(1) { animation-delay: 100ms; }
  .column:nth-child(2) { animation-delay: 180ms; }
  .column:nth-child(3) { animation-delay: 260ms; }

  .pcard:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
  }

  .pcard img {
    transition: transform 500ms var(--ease);
  }

  .pcard:hover img {
    transform: scale(1.03);
  }

  .empty-icon .icon {
    animation: float 3.2s ease-in-out infinite;
  }

  @keyframes float {
    50% { transform: translateY(-4px); }
  }

  /* contact */
  .contact li {
    animation: rise 560ms var(--ease) both;
  }

  .contact li:nth-child(1) { animation-delay: 160ms; }
  .contact li:nth-child(2) { animation-delay: 240ms; }

  .illustration .plane {
    transform-box: fill-box;
    transform-origin: center;
    animation: plane 4.5s ease-in-out infinite;
  }

  .illustration .i-dash {
    animation: dash 1.4s linear infinite;
  }

  @keyframes plane {
    50% { transform: translate(6px, -7px) rotate(-3deg); }
  }

  @keyframes dash {
    to { stroke-dashoffset: -22; }
  }
}

@media (prefers-reduced-motion: reduce) {
  @view-transition {
    navigation: none;
  }
}
