/* Lukas Hain — minimal personal site */

:root {
  --bg:        #faf7f1;
  --fg:        #1a1714;
  --fg-soft:   #5a544b;
  --fg-mute:   #998f80;
  --rule:      #e6dfd0;
  --accent:    #b8472b;

  --serif: "Instrument Serif", Georgia, serif;
  --sans:  "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;

  --container: 720px;
  --gutter: clamp(20px, 5vw, 40px);
  --ease: cubic-bezier(.2, .7, .15, 1);
}

html[data-theme="dark"] {
  --bg:      #131210;
  --fg:      #ece5d5;
  --fg-soft: #a8a090;
  --fg-mute: #706756;
  --rule:    #29251f;
  --accent:  #e8825f;
}

* { box-sizing: border-box; }
*::selection { background: var(--accent); color: var(--bg); }

html { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  letter-spacing: -.005em;
  min-height: 100dvh;
  transition: background-color .5s var(--ease), color .5s var(--ease);
}

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

/* ── Nav ── */

.nav {
  max-width: var(--container);
  margin: 0 auto;
  padding: 32px var(--gutter);
  display: flex; align-items: center; gap: clamp(16px, 4vw, 32px);
}
.nav__brand {
  font-family: var(--serif);
  font-size: 20px;
  letter-spacing: -.01em;
  margin-right: auto;
}
.nav__links { display: flex; gap: clamp(14px, 3vw, 28px); }
.nav__links a,
.nav__brand {
  position: relative;
  font-size: 14px;
  color: var(--fg-soft);
  font-weight: 400;
  transition: color .25s var(--ease);
}
.nav__brand { color: var(--fg); font-size: 20px; }
.nav__links a::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: -4px;
  height: 1px; background: currentColor;
  transition: right .35s var(--ease);
}
.nav__links a:hover { color: var(--fg); }
.nav__links a:hover::after { right: 0; }

.theme-toggle {
  width: 32px; height: 32px;
  background: transparent; border: 0; padding: 0;
  color: var(--fg-soft); cursor: pointer;
  display: grid; place-items: center;
  transition: color .25s var(--ease);
}
.theme-toggle:hover { color: var(--fg); }
.theme-toggle__icon {
  width: 18px; height: 18px;
  stroke: currentColor; stroke-width: 1.4; fill: none; stroke-linecap: round;
}
.theme-toggle__sun, .theme-toggle__rays line, .theme-toggle__moon {
  transition: opacity .3s var(--ease);
}
html[data-theme="light"] .theme-toggle__moon { opacity: 0; }
html[data-theme="dark"]  .theme-toggle__sun,
html[data-theme="dark"]  .theme-toggle__rays line { opacity: 0; }

/* ── Layout ── */

main { max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }

.section { padding: 80px 0 40px; }

.section__title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 14px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--fg-mute);
  margin: 0 0 32px;
  font-style: normal;
}

.serif-it { font-family: var(--serif); font-style: italic; color: var(--accent); }

/* ── Hero ── */

.hero { padding: 80px 0 40px; }

.hero__title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(34px, 5.4vw, 52px);
  line-height: 1.12;
  letter-spacing: -.015em;
  margin: 0 0 28px;
  color: var(--fg);
}

.hero__lede {
  color: var(--fg-soft);
  max-width: 56ch;
  margin: 0;
  font-size: 17px;
}

/* ── Posts ── */

.posts { list-style: none; padding: 0; margin: 0; }
.post { border-top: 1px solid var(--rule); }
.post:last-child { border-bottom: 1px solid var(--rule); }

.post__link {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 20px;
  padding: 18px 0;
  align-items: baseline;
  transition: color .3s var(--ease);
}
.post__date {
  font-size: 13px;
  color: var(--fg-mute);
}
.post__title {
  font-family: var(--serif);
  font-size: 22px;
  line-height: 1.3;
  letter-spacing: -.01em;
  color: var(--fg);
  transition: color .3s var(--ease);
}
.post__link:hover .post__title { color: var(--accent); }

/* ── Work ── */

.work { list-style: none; padding: 0; margin: 0; }
.work__item {
  display: grid;
  grid-template-columns: 90px 140px 1fr;
  gap: 20px;
  padding: 14px 0;
  align-items: baseline;
  border-top: 1px solid var(--rule);
  font-size: 15px;
}
.work__item:last-child { border-bottom: 1px solid var(--rule); }
.work__year { color: var(--fg-mute); font-size: 13px; }
.work__title {
  font-family: var(--serif);
  font-size: 18px;
  color: var(--fg);
}
.work__desc { color: var(--fg-soft); }

/* ── Contact ── */

.contact__lede {
  color: var(--fg-soft);
  max-width: 56ch;
  margin: 0 0 24px;
}
.contact__mail {
  font-family: var(--serif);
  font-size: clamp(28px, 4vw, 40px);
  letter-spacing: -.015em;
  color: var(--accent);
  display: inline-block;
  position: relative;
  padding-bottom: 4px;
}
.contact__mail::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: 0;
  height: 1px; background: currentColor;
  transition: right .4s var(--ease);
}
.contact__mail:hover::after { right: 0; }

.socials {
  list-style: none; padding: 0; margin: 40px 0 0;
  display: flex; flex-wrap: wrap; gap: 4px 24px;
}
.socials a {
  position: relative; padding: 4px 0;
  font-size: 14px; color: var(--fg-soft);
  transition: color .25s var(--ease);
}
.socials a::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: 0;
  height: 1px; background: currentColor;
  transition: right .35s var(--ease);
}
.socials a:hover { color: var(--fg); }
.socials a:hover::after { right: 0; }

/* ── Footer ── */

.foot {
  max-width: var(--container);
  margin: 0 auto;
  padding: 80px var(--gutter) 40px;
  font-size: 13px;
  color: var(--fg-mute);
}
.foot p { margin: 0; }

/* ── Reveal ── */

.reveal {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .7s var(--ease) var(--d, 0s), transform .7s var(--ease) var(--d, 0s);
}
.reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1 !important; transform: none !important; }
  *, *::before, *::after { transition-duration: .001ms !important; }
}

/* ── Responsive ── */

@media (max-width: 600px) {
  .post__link { grid-template-columns: 1fr; gap: 4px; }
  .work__item { grid-template-columns: 70px 1fr; gap: 12px; }
  .work__item .work__desc { grid-column: 1 / -1; color: var(--fg-mute); font-size: 14px; }
}
