/* hrkltz.io — minimal Swiss-grid layout
   Light is the default, dark mirrors prefers-color-scheme. */

:root {
  --fg: #0a0a0a;
  --bg: #ffffff;
  --muted: #6b6b6b;
  --rule: #e5e5e0;
  --accent: crimson;
}

@media (prefers-color-scheme: dark) {
  :root {
    --fg: #efece6;
    --bg: #050505;
    --muted: #9a9690;
    --rule: #2a2926;
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; }

/* ── Page */
.page {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  column-gap: 24px;
  row-gap: 56px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 56px clamp(20px, 5vw, 64px) 48px;
}

.page > * { grid-column: 1 / -1; }

/* ── Header */
.top {
  display: flex;
  justify-content: space-between;
  align-items: start;
}
.mark {
  display: inline-flex;
  color: var(--fg);
  text-decoration: none;
}
.mark svg { display: block; width: 44px; height: 44px; }
.meta {
  text-align: right;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  padding-top: 6px;
  white-space: nowrap;
}
.meta span { display: block; }

/* ── Lockup */
.lockup {
  display: grid;
  grid-template-columns: subgrid;
  align-items: end;
}
.lockup h1 {
  grid-column: 3 / span 10;
  margin: 0;
  font-size: clamp(48px, 8vw, 80px);
  line-height: 0.92;
  font-weight: 600;
  letter-spacing: -0.035em;
}
.lockup h1 .grey,
.lockup h1 repeat-word.grey { color: var(--muted); }

.ipa {
  grid-column: 3 / span 9;
  margin-top: 18px;
  font-size: 13px;
  color: var(--muted);
  display: flex;
  gap: 8px;
  align-items: center;
}
.ipa a {
  color: inherit;
  text-decoration: none;
  transition: color 200ms;
}
.ipa a:hover { color: var(--accent); }

/* ── Intro */
.intro {
  grid-column: 3 / span 9;
  margin: 0;
  font-size: 17px;
  line-height: 1.55;
  text-wrap: pretty;
}
.intro .muted { color: var(--muted); }
.intro strong { font-weight: 500; }

/* ── Projects */
.projects {
  display: grid;
  grid-template-columns: subgrid;
}
.section-label {
  grid-column: 1 / span 2;
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--muted);
}
.project-list {
  grid-column: 3 / span 9;
  list-style: none;
  margin: 0;
  padding: 0;
}
.project-list .row {
  display: grid;
  grid-template-columns: 28px 1fr auto auto;
  align-items: baseline;
  gap: 16px;
  padding: 18px 0;
  border-top: 1px solid var(--rule);
  text-decoration: none;
  color: inherit;
  position: relative;
  transition: color 220ms ease;
}
.project-list li:last-child .row { border-bottom: 1px solid var(--rule); }
.row .num {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.08em;
  font-family: ui-monospace, monospace;
}
.row .num::before { content: "#"; }
.row .name {
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.01em;
  display: inline-block;
}
.row .desc {
  font-size: 13px;
  color: var(--muted);
  text-align: right;
}
.row .arrow {
  font-size: 14px;
  color: var(--muted);
  transition: transform 220ms ease, color 220ms ease;
}
.row::after {
  content: "";
  position: absolute;
  left: 44px;
  right: 16px;
  bottom: 12px;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 320ms cubic-bezier(.22,.61,.36,1);
}
.row:hover { color: var(--accent); }
.row:hover::after { transform: scaleX(1); }
.row:hover .arrow {
  color: var(--accent);
  transform: translate(2px, -2px);
}

/* ── Footer */
.bottom {
  display: grid;
  grid-template-columns: subgrid;
  align-items: end;
  padding-top: 24px;
  border-top: 1px solid var(--rule);
  font-size: 12px;
  color: var(--muted);
}
.legal {
  grid-column: 1 / span 8;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.legal a {
  color: inherit;
  text-decoration: none;
  transition: color 200ms;
}
.legal a:hover { color: var(--accent); }
.legal .sep { opacity: 0.4; }
.social {
  grid-column: 9 / span 4;
  display: flex;
  gap: 14px;
  justify-content: flex-end;
}
.social a {
  display: inline-flex;
  transition: color 200ms;
}
.social a:hover { color: var(--accent); }

/* ── repeat-word */
repeat-word { display: inline-block; }
repeat-word .rl {
  display: inline-block;
  animation-iteration-count: 1;
  animation-fill-mode: both;
  animation-duration: 1.4s;
  animation-play-state: paused;
  animation-name: none;
}
repeat-word.is-playing .rl {
  animation-name: hrkltz-rep-wave;
  animation-play-state: running;
}
@keyframes hrkltz-rep-wave {
  0%   { color: var(--muted); }
  35%  { color: var(--fg);    transform: translateY(-2px); }
  70%  { color: var(--fg);    transform: translateY(0); }
  100% { color: var(--muted); }
}
@media (prefers-reduced-motion: reduce) {
  repeat-word .rl { animation: none !important; }
}

/* ── IPA pronounce */
.ipa .pronounce {
  display: inline-flex;
  opacity: 0.6;
  transition: opacity 180ms, color 180ms;
}
.ipa .pronounce:hover { opacity: 1; }
.ipa .pronounce svg { display: block; }

/* ── Mobile (≤ 720px) */
@media (max-width: 720px) {
  .page {
    display: block;
    padding: 32px 22px 28px;
  }
  .page > * + * { margin-top: 32px; }

  .top { justify-content: flex-end; align-items: center; }
  .mark { display: none; }
  .meta { padding-top: 0; }

  .lockup { display: block; }
  .lockup h1 { font-size: 44px; line-height: 0.96; }
  .ipa { margin-top: 14px; }

  .intro { font-size: 15px; }

  .projects { display: block; }
  .section-label { margin-bottom: 8px; }
  .project-list .row {
    grid-template-columns: 22px 1fr auto;
    grid-template-rows: auto auto;
    gap: 4px 12px;
    padding: 14px 0;
  }
  .project-list .row .num   { grid-row: 1; grid-column: 1; }
  .project-list .row .name  { grid-row: 1; grid-column: 2; }
  .project-list .row .arrow { grid-row: 1; grid-column: 3; }
  .project-list .row .desc  { grid-row: 2; grid-column: 2; display: block; text-align: left; }
  .row::after { left: 34px; right: 16px; bottom: auto; top: calc(14px + 18px * 1.2); }

  .bottom { display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
  .social { gap: 16px; }
}
