@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:ital,wght@0,400;0,500;1,400;1,500&family=Space+Grotesk:wght@400;500;600&display=swap");

:root {
  --bg: #fff;
  --fg: #000;

  --serif: "Space Grotesk", ui-sans-serif, system-ui, -apple-system,
    BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;

  --page-max: 70rem;
  --page-pad: clamp(1.25rem, 4vw, 2.75rem);
  --status-bar-height: 56px;
}

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

html {
  color-scheme: light;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--mono);
  line-height: 1.55;
  text-rendering: geometricPrecision;
  -webkit-font-smoothing: antialiased;
}

main,
header,
footer {
  display: block;
}

header,
main,
footer {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 0 var(--page-pad);
}

header {
  padding-top: calc(clamp(3rem, 8vw, 6rem) + var(--status-bar-height));
  padding-bottom: 96px;
}

main {
  padding-bottom: clamp(4rem, 10vw, 7rem);
}

footer {
  padding-bottom: clamp(3rem, 8vw, 6rem);
}

footer[aria-labelledby="contact-title"] {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 1.5rem;
  row-gap: 0.5rem;
}

footer[aria-labelledby="contact-title"] p + p {
  margin-top: 0;
}

footer[aria-labelledby="contact-title"] #contact-title {
  font-size: 15px;
  font-weight: 500;
  margin-bottom: 0;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  line-height: 1.05;
}

h1 {
  font-size: clamp(4rem, 10vw, 7.5rem);
  letter-spacing: -0.02em;
}

#hero-title {
  font-size: 24px;
  font-weight: 600;
  padding-bottom: 0.5rem;
}

h2 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  margin-bottom: 1rem;
}

h3 {
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  margin-top: 0.75rem;
}

p {
  margin: 0;
}

p + p {
  margin-top: 1rem;
}

section + section {
  margin-top: clamp(3.5rem, 8vw, 6rem);
}

.work-wip {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.terminal-cursor {
  display: inline-block;
  width: 0.6ch;
  animation: terminal-blink 1s steps(1, end) infinite;
}

@keyframes terminal-blink {
  0%,
  49% {
    opacity: 1;
  }
  50%,
  100% {
    opacity: 0;
  }
}

/* Hero overlap treatment */
header section p {
  margin-top: 0;
  padding-left: 0.02em;
  font-size: 15px;
  line-height: 1.2;
}

.status {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  background: #fff;
  margin: 0;
  height: var(--status-bar-height);
  display: block;
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.status-inner {
  max-width: var(--page-max);
  margin: 0 auto;
  height: 100%;
  padding: 0 var(--page-pad);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.6rem;
  font-size: 0.75rem;
  line-height: 1.2;
}

.status-brand {
  font-family: var(--mono);
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-2px);
  transition: opacity 240ms ease, transform 240ms ease, visibility 0s linear 240ms;
}

.status-right {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  will-change: transform;
  min-width: 0;
}

.status-text-long {
  display: inline;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 600px) {
  .status-text-long {
    display: none;
  }

  /* keep bar behavior; only shorten text on mobile */
}

.status--scrolled {
}

.status--scrolled .status-inner {
  justify-content: flex-start;
}

.status--scrolled .status-brand {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition-delay: 0s;
}

.status--scrolled .status-right {
  animation: none;
  margin-left: 0;
}

@keyframes status-slide-left {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-0.5rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  .status-brand {
    transition: none;
  }
  .status--scrolled .status-right {
    animation: none;
  }
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #f59e0b;
  flex: 0 0 8px;
  animation: status-pulse 2.8s ease-in-out infinite;
}

@keyframes status-pulse {
  0%,
  100% {
    opacity: 0.55;
  }
  50% {
    opacity: 1;
  }
}

/* About */
main#content > section[aria-label="About"] > p {
  font-size: 15px;
}

main#content > section[aria-label="About"] > p:first-of-type {
  font-weight: 500;
}

@media (min-width: 48rem) {
  main#content > section[aria-label="About"] > p {
    width: 70%;
  }
}

#about-title + p {
  max-width: 70ch;
}

#about-title + p ~ p {
  margin-top: 1rem;
  max-width: 70ch;
}

/* Work list */
ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

#work-title + ul {
  margin-top: 1.25rem;
  display: grid;
  gap: clamp(1.5rem, 4vw, 2.5rem);
  grid-template-columns: 1fr;
}

article p {
  margin-top: 0.5rem;
  font-size: 0.95rem;
}

figure {
  margin: 0;
}

figure > div[aria-hidden="true"] {
  width: 100%;
  aspect-ratio: 16 / 10;
  background: var(--fg);
  color: var(--bg);
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 0.9rem;
}

/* Links: underline on hover only */
a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

a:hover,
a:focus-visible {
  text-decoration: underline;
}

/* Simple responsive refinement */
@media (min-width: 48rem) {
  header {
    padding-bottom: clamp(6rem, 12vw, 12rem);
  }
}

@media (min-width: 62rem) {
  #work-title + ul {
    grid-template-columns: repeat(3, 1fr);
  }
}
