/* Project detail pages. Same rule as the résumé: the page is monochrome and the
   only colour on it is a measurement. */

:root {
  --paper: #ffffff;
  --desk: #e9ecec;
  --ink: #14171c;
  --ink-2: #464e59;
  --ink-3: #79828e;
  --ink-4: #a6aeb8;
  --rule: #e2e6ea;
  --rule-strong: #c6ccd3;
  --measure: #0b6e61;
  --measure-wash: rgba(11, 110, 97, 0.09);

  --font-sans: "IBM Plex Sans KR", -apple-system, BlinkMacSystemFont,
    "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  --font-mono: "IBM Plex Mono", "IBM Plex Sans KR", ui-monospace, SFMono-Regular,
    Menlo, monospace;

  --rail: 168px;
  --gutter: 40px;
  --measure-col: 720px;

  color-scheme: light;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

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

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.68;
  color: var(--ink);
  background: var(--paper);
  word-break: keep-all;
  overflow-wrap: anywhere;
}

h1,
h2,
h3,
p,
ul,
ol,
dl,
dd,
dt,
figure {
  margin: 0;
  padding: 0;
}

ul {
  list-style: none;
}

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

img {
  display: block;
  max-width: 100%;
  height: auto;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

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

/* ----------------------------------------------------------------- frame */

.page {
  display: grid;
  grid-template-columns: var(--rail) minmax(0, var(--measure-col));
  gap: 0 var(--gutter);
  justify-content: center;
  padding: 56px 32px 120px;
}

/* ------------------------------------------------------------------ rail */

.rail {
  grid-column: 1;
}

.rail__sticky {
  position: sticky;
  top: 56px;
}

.rail__back {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-3);
  margin-bottom: 26px;
  transition: color 0.15s;
}

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

.rail__lang {
  display: flex;
  gap: 6px;
  margin-bottom: 26px;
  font-family: var(--font-mono);
  font-size: 10.5px;
}

.rail__lang span,
.rail__lang a {
  padding: 3px 8px;
  color: var(--ink-3);
  border: 1px solid var(--rule);
}

.rail__lang span {
  color: var(--paper);
  background: var(--ink);
  border-color: var(--ink);
}

.rail__lang a:hover {
  color: var(--ink);
  border-color: var(--rule-strong);
}

.rail__nav {
  display: grid;
  gap: 1px;
  border-left: 1px solid var(--rule);
}

.rail__nav a {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-4);
  padding: 5px 0 5px 12px;
  margin-left: -1px;
  border-left: 1px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}

.rail__nav a:hover {
  color: var(--ink-2);
}

.rail__nav a[aria-current="true"] {
  color: var(--ink);
  border-left-color: var(--measure);
}

/* ------------------------------------------------------------------ main */

.main {
  grid-column: 2;
}

/* ------------------------------------------------------------------ hero */

.hero__logo {
  width: 44px;
  height: 44px;
  object-fit: contain;
  margin-bottom: 18px;
}

.hero__title {
  font-size: 44px;
  font-weight: 600;
  letter-spacing: -0.028em;
  line-height: 1.05;
}

.hero__subtitle {
  margin-top: 10px;
  font-size: 17px;
  color: var(--ink-2);
  max-width: 46ch;
}

.hero__meta {
  margin-top: 20px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-3);
}

.hero__sep {
  color: var(--ink-4);
  padding: 0 9px;
}

/* The meta line mixes three kinds of fact — dates, team size, my role. Only the
   role answers "what did he do here", so it is the one that takes ink weight.
   Deliberately not the measure colour: teal on this site means a result. */
.hero__role {
  color: var(--ink);
  font-weight: 500;
}

/* --------------------------------------------------------------- section */

.section {
  margin-top: 52px;
  scroll-margin-top: 56px;
}

.section__label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding-bottom: 10px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 20px;
}

:lang(ko) .section__label,
:lang(ko) .stack,
:lang(ko) .reflection dt,
:lang(ko) .figure figcaption {
  word-spacing: -0.3em;
}

/* --------------------------------------------------------------- content */

.lead {
  font-size: 16px;
  color: var(--ink-2);
  max-width: 60ch;
}

.stack {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--ink-2);
}

.stack__sep {
  color: var(--ink-4);
  padding: 0 7px;
}

.roles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 28px;
  max-width: 60ch;
}

.roles li {
  position: relative;
  padding-left: 14px;
  font-size: 13.5px;
  color: var(--ink-2);
}

.roles li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 4px;
  height: 4px;
  background: var(--ink-4);
}

.wins {
  display: grid;
  gap: 22px;
}

.wins li + li {
  padding-top: 22px;
  border-top: 1px solid var(--rule);
}

.wins h3 {
  font-size: 15.5px;
  font-weight: 600;
  letter-spacing: -0.012em;
  margin-bottom: 5px;
}

.wins p {
  color: var(--ink-2);
  max-width: 62ch;
}

/* --------------------------------------------------------------- figures */

.diagram {
  border: 1px solid var(--rule);
  padding: 18px;
}

.diagram img {
  width: 100%;
}

.figure figcaption,
.shots figcaption {
  margin-top: 9px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--ink-3);
}

.hint {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--ink-4);
  margin-bottom: 14px;
}

.shots {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.shot {
  display: block;
  width: 100%;
  text-align: left;
}

/* Source screenshots vary in aspect; a fixed ratio keeps captions on one line
   across the grid. Anchored top-left because that is where the UI chrome is. */
.shot img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  object-position: top left;
  border: 1px solid var(--rule);
  transition: border-color 0.18s;
}

.shot:hover img {
  border-color: var(--ink-4);
}

.shot:hover figcaption {
  color: var(--ink);
}

/* ------------------------------------------------------------ reflection */

.reflection {
  display: grid;
  gap: 20px;
  max-width: 62ch;
}

.reflection dt {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 5px;
}

.reflection dd {
  color: var(--ink-2);
}

/* ----------------------------------------------------------------- links */

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
}

.link {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-2);
  border-bottom: 1px solid var(--rule-strong);
  padding-bottom: 2px;
  transition: color 0.15s, border-color 0.15s;
}

.link::after {
  content: "↗";
  font-size: 0.85em;
  padding-left: 4px;
  color: var(--ink-4);
}

.link:hover,
.link:hover::after {
  color: var(--ink);
}

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

/* --------------------------------------------------------------- measure */

.m-num {
  font-family: var(--font-mono);
  font-size: 0.94em;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--measure);
  background: linear-gradient(transparent 80%, var(--measure-wash) 80%);
  padding: 0 1px;
}

.m-arrow {
  font-family: var(--font-mono);
  color: var(--ink-4);
  padding: 0 2px;
}

/* -------------------------------------------------------------- lightbox */

.lightbox {
  border: 0;
  padding: 0;
  max-width: 92vw;
  max-height: 92vh;
  background: var(--paper);
  box-shadow: 0 24px 70px rgba(20, 23, 28, 0.3);
}

.lightbox::backdrop {
  background: rgba(20, 23, 28, 0.72);
}

.lightbox img {
  max-width: 92vw;
  max-height: calc(92vh - 46px);
  object-fit: contain;
}

.lightbox__bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 11px 16px;
  border-top: 1px solid var(--rule);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-3);
}

.lightbox__close {
  color: var(--ink-3);
  letter-spacing: 0.08em;
  transition: color 0.15s;
}

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

/* ------------------------------------------------------------ responsive */

@media (max-width: 1020px) {
  :root {
    --rail: 128px;
    --gutter: 28px;
  }

  .page {
    padding: 40px 24px 90px;
  }

  .hero__title {
    font-size: 36px;
  }
}

@media (max-width: 760px) {
  .page {
    grid-template-columns: minmax(0, 1fr);
    padding: 24px 18px 72px;
  }

  .rail,
  .main {
    grid-column: 1;
  }

  .rail__sticky {
    position: static;
  }

  .rail__nav {
    display: none;
  }

  .hero__title {
    font-size: 31px;
  }

  .roles,
  .shots {
    grid-template-columns: 1fr;
  }

  .section {
    margin-top: 38px;
  }
}

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