/* Napat's portfolio — departures-board theme */
:root {
  --board: #1c2638;      /* departures board */
  --board-2: #26324a;    /* flap tile */
  --signal: #ffc72c;     /* airport signage yellow */
  --sky: #5aa9e6;        /* sky blue */
  --paper: #eef1f5;      /* page background */
  --ink: #1c2638;        /* body text */
  --muted: #5b6678;
  --line: #d3d9e2;

  --f-display: "Archivo", system-ui, sans-serif;
  --f-body: "Atkinson Hyperlegible", system-ui, sans-serif;
  --f-flap: "IBM Plex Mono", ui-monospace, monospace;

  --step-0: 1.0625rem;
  --step-1: 1.3rem;
  --step-2: 1.75rem;
  --step-3: clamp(2.1rem, 4vw, 2.8rem);
  --wrap: 68rem;
}

@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .35s; }
.site-header { view-transition-name: header; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 var(--step-0)/1.6 var(--f-body);
}
img { max-width: 100%; display: block; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--signal); outline-offset: 3px; border-radius: 2px; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }

/* ---------- header / nav ---------- */
.site-header {
  background: var(--board);
  color: #fff;
  position: sticky; top: 0; z-index: 10;
  border-bottom: 1px solid #ffffff14;
}
.site-header .wrap { width: min(100% - 2.5rem, 86rem); display: flex; align-items: center; gap: 1.5rem; min-height: 4rem; }
.brand {
  display: flex; align-items: center; gap: .6rem;
  text-decoration: none; font: 700 1.05rem/1 var(--f-display); font-stretch: 85%;
  white-space: nowrap;
}
.brand-mark {
  display: grid; place-items: center; width: 2.1rem; height: 2.1rem;
  background: var(--signal); color: var(--board); border-radius: 4px;
  font: 600 .95rem/1 var(--f-flap);
}
.nav { margin-left: auto; }
.nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: .15rem; flex-wrap: wrap; justify-content: flex-end; }
.nav a {
  display: block; padding: .45rem .65rem; border-radius: 4px;
  text-decoration: none; font: 500 .88rem/1.2 var(--f-body); color: #c9d3e3; white-space: nowrap;
  transition: background .15s, color .15s;
}
.nav a:hover { background: #ffffff12; color: #fff; }
.nav a[aria-current="page"] { color: var(--board); background: var(--signal); }
.nav-toggle { display: none; }

@media (max-width: 1480px) {
  .nav-toggle {
    display: inline-flex; align-items: center; gap: .5rem; margin-left: auto;
    background: transparent; color: #fff; border: 1px solid #ffffff33; border-radius: 4px;
    padding: .45rem .8rem; font: 500 .95rem var(--f-body); cursor: pointer;
  }
  .nav { position: absolute; inset: 100% 0 auto 0; background: var(--board); border-bottom: 1px solid #ffffff14;
    display: grid; grid-template-rows: 0fr; transition: grid-template-rows .3s ease; }
  .nav > ul { overflow: hidden; flex-direction: column; padding: 0 1.25rem; }
  .nav.open { grid-template-rows: 1fr; }
  .nav.open > ul { padding-block: .5rem 1rem; }
  .nav a { padding: .7rem .5rem; font-size: 1rem; }
}

/* ---------- split-flap ---------- */
.board {
  background: var(--board);
  color: #fff;
  padding-block: clamp(2.5rem, 7vw, 5rem) clamp(2rem, 5vw, 3.5rem);
  overflow: hidden;
}
.flap-line { display: flex; flex-wrap: wrap; column-gap: clamp(.8rem, 2vw, 1.6rem); row-gap: clamp(4px, .6vw, 8px); margin: 0; }
.flap-word { display: flex; gap: clamp(3px, .5vw, 6px); }
.flap-line + .flap-line { margin-top: clamp(4px, .6vw, 8px); }
.flap {
  --size: clamp(1.7rem, 8.4vw, 4.4rem);
  flex-shrink: 0;
  position: relative;
  width: calc(var(--size) * .78); height: var(--size);
  display: grid; place-items: center;
  background: linear-gradient(#2d3a55 0 50%, var(--board-2) 50% 100%);
  border-radius: 4px;
  font: 600 calc(var(--size) * .66)/1 var(--f-flap);
  color: var(--signal);
  box-shadow: inset 0 -2px 0 #0000002e;
}
.flap::after { /* hinge line */
  content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 2px;
  background: var(--board); transform: translateY(-1px);
}
.flap.space { background: transparent; box-shadow: none; }
.flap.space::after { display: none; }
.flap.tick { animation: tick .07s linear; }
@keyframes tick { 50% { transform: scaleY(.82); filter: brightness(1.25); } }
.flap-small .flap { --size: clamp(1.6rem, 5.4vw, 2.8rem); }

.board-meta { margin: 1.6rem 0 0; color: #c9d3e3; font-size: var(--step-1); max-width: 40ch; }
.board-meta strong { color: #fff; }

/* ---------- departures table ---------- */
.departures { margin-top: clamp(2rem, 5vw, 3rem); border-top: 1px solid #ffffff1f; }
.departures-head, .dep-row {
  display: grid; grid-template-columns: 4.5rem 1fr 9rem; align-items: center; gap: 1rem;
}
.departures-head {
  padding: .8rem 0 .5rem; color: #8e9bb3; font: 500 .85rem/1 var(--f-body);
}
.dep-row {
  padding: .85rem .25rem; text-decoration: none; border-top: 1px solid #ffffff14;
  transition: background .15s, padding .2s;
}
.dep-row:hover, .dep-row:focus-visible { background: #ffffff0d; padding-inline: .75rem; }
.dep-gate { font: 600 1rem/1 var(--f-flap); color: var(--signal); }
.dep-dest { font: 600 var(--step-1)/1.2 var(--f-display); font-stretch: 90%; }
.dep-status { font: 500 .95rem/1 var(--f-body); color: #8e9bb3; text-align: right; }
.dep-status.boarding { color: #7ee2a8; }
.dep-status.boarding::before { content: ""; display: inline-block; width: .55rem; height: .55rem; border-radius: 50%; background: currentColor; margin-right: .45rem; animation: blink 1.6s infinite; }
@keyframes blink { 50% { opacity: .25; } }
@media (max-width: 560px) {
  .departures-head, .dep-row { grid-template-columns: 3rem 1fr auto; gap: .6rem; }
  .dep-dest { font-size: 1.1rem; }
  .dep-status { font-size: .85rem; }
}

/* ---------- content ---------- */
main { display: block; }
.section { padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.section + .section { padding-top: 0; }
h1, h2, h3 { font-family: var(--f-display); line-height: 1.15; margin: 0; }
h2 { font-size: var(--step-3); font-weight: 800; font-stretch: 80%; letter-spacing: -.01em; }
h3 { font-size: var(--step-1); font-weight: 700; }
.prose p { margin: 1rem 0 0; max-width: 64ch; }
.prose p:first-of-type { margin-top: 1.1rem; }
.lead { font-size: var(--step-1); line-height: 1.5; color: var(--ink); max-width: 46ch; margin: 1rem 0 0; }

.split { display: grid; gap: clamp(2rem, 5vw, 4rem); grid-template-columns: 1fr 1fr; }
@media (max-width: 820px) { .split { grid-template-columns: 1fr; } }

/* boarding pass = the goal */
.pass {
  position: relative; background: #fff; border-radius: 10px;
  display: grid; grid-template-columns: 1fr auto;
  border: 1px solid var(--line);
}
.pass-main { padding: 1.6rem 1.75rem; }
.pass-stub {
  padding: 1.6rem 1.4rem; border-left: 2px dashed var(--line);
  display: flex; flex-direction: column; justify-content: space-between; gap: 1rem; width: 15rem;
  background: var(--signal); border-radius: 0 10px 10px 0;
}
.pass::before, .pass::after { /* punched notches */
  content: ""; position: absolute; right: calc(15rem - .7rem); width: 1.4rem; height: 1.4rem; border-radius: 50%; background: var(--paper);
}
.pass::before { top: -.75rem; border-bottom: 1px solid var(--line); }
.pass::after { bottom: -.75rem; border-top: 1px solid var(--line); }
.pass-field { font-size: .85rem; color: var(--muted); }
.pass-field b { display: block; color: var(--ink); font: 600 1.05rem/1.25 var(--f-flap); margin-top: .15rem; }
.pass-stub .pass-field { color: #5a4a10; }
@media (max-width: 560px) {
  .pass { grid-template-columns: 1fr; }
  .pass-stub { border-left: 0; border-top: 2px dashed #00000022; border-radius: 0 0 10px 10px; flex-direction: row; flex-wrap: wrap; width: auto; }
  .pass::before, .pass::after { display: none; }
}

.interests { list-style: none; padding: 0; margin: 1.5rem 0 0; display: grid; gap: 0; }
.interests li { display: grid; grid-template-columns: 2.5rem 1fr; gap: 1rem; padding: 1.1rem 0; border-top: 1px solid var(--line); align-items: start; }
.interests li:last-child { border-bottom: 1px solid var(--line); }
.interests svg { width: 2.2rem; height: 2.2rem; color: var(--sky); }
.interests p { margin: .2rem 0 0; color: var(--muted); }

/* skills */
.skill-grid { list-style: none; padding: 0; margin: 2rem 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 1rem; }
.skill {
  background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 1.4rem;
  display: flex; flex-direction: column; gap: 1.2rem; min-height: 11rem;
  transition: transform .2s ease, border-color .2s;
}
.skill:hover { transform: translateY(-3px); border-color: var(--sky); }
.skill svg { width: 2.6rem; height: 2.6rem; color: var(--sky); }
.skill h3 { margin-top: auto; }
.skill p { margin: .3rem 0 0; color: var(--muted); font-size: .95rem; }

/* tags */
.tags { list-style: none; padding: 0; margin: 1.25rem 0 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.tags li { background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: .35rem .9rem; font-size: .95rem; }
.tags.strong li { background: var(--board); color: #fff; border-color: var(--board); }

/* empty state */
.empty {
  margin-top: 2rem; padding: 1.75rem; border: 2px dashed #b9c3d2; border-radius: 10px;
  display: grid; grid-template-columns: auto 1fr; gap: 1.25rem; align-items: center; max-width: 46rem;
}
.empty svg { width: 2.6rem; height: 2.6rem; color: var(--muted); }
.empty h3 { font-size: 1.1rem; }
.empty p { margin: .25rem 0 0; color: var(--muted); }

.page-next { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 1.5rem; margin-top: 3rem; }
.page-next a { text-decoration: none; display: block; }
.page-next small { display: block; color: var(--muted); font-size: .85rem; }
.page-next span { font: 700 1.15rem/1.3 var(--f-display); }
.page-next a:hover span { text-decoration: underline; text-underline-offset: 4px; }
.page-next .next { text-align: right; margin-left: auto; }

/* footer */
.site-footer { background: var(--board); color: #8e9bb3; padding-block: 2rem; font-size: .92rem; margin-top: 2rem; }
.site-footer .wrap { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.site-footer a { color: #c9d3e3; }

/* plane flying across hero */
.plane {
  position: absolute; width: 2.2rem; color: #ffffff30; top: 18%; left: -3rem;
  animation: fly 22s linear infinite;
}
@keyframes fly { to { transform: translateX(calc(100vw + 6rem)); } }
.board { position: relative; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .plane { display: none; }
}
