/* Taagaard Holding — homepage styles */

/*
  Metric-matched stand-ins shown while the Google Fonts load, so swapping them in doesn't
  re-wrap the headline and shift the page. size-adjust = web font width / local font width.
*/
@font-face {
  font-family: 'Syne fallback';
  font-weight: 800;
  src: local('Arial Black'), local('Arial-Black');
  size-adjust: 140%;
}

@font-face {
  font-family: 'Syne fallback';
  font-weight: 700;
  src: local('Arial Black'), local('Arial-Black');
  size-adjust: 97%;
}

@font-face {
  font-family: 'IBM Plex Sans fallback';
  src: local('Arial'), local('ArialMT'), local('Helvetica'), local('Liberation Sans');
  size-adjust: 101.5%;
}

:root {
  /* Colour */
  --bg: #07080B;
  --bg-raised: #0A0C10;
  --surface: #0C0E13;
  --line: #22252E;
  --line-strong: #3A3F4B;
  --text: #ECEAE4;
  --text-soft: #A3A9B4;
  --muted: #9097A3;
  --accent: #FFB547;
  --accent-hot: #FFF4DC;

  /* Type */
  --font-display: 'Syne', 'Syne fallback', 'Arial Black', sans-serif;
  --font-body: 'IBM Plex Sans', 'IBM Plex Sans fallback', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* Layout */
  --max: 1360px;
  --gutter: clamp(16px, 4vw, 48px);
  --section-y: clamp(56px, 8vw, 112px);
  --header-h: 76px;
  --tap: 44px;

  color-scheme: dark;
}

/* ---------- Base ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img,
svg,
canvas {
  display: block;
  max-width: 100%;
}

a {
  color: var(--text);
}

a:hover {
  color: var(--accent);
}

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

main:focus {
  outline: none;
}

.accent-dot {
  color: var(--accent);
}

::selection {
  background: var(--accent);
  color: var(--bg);
}

.wrap {
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.eyebrow {
  margin: 0 0 12px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent);
}

.skip-link {
  position: absolute;
  top: 8px;
  left: var(--gutter);
  z-index: 10;
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  padding: 0 16px;
  border-radius: 4px;
  background: var(--accent);
  color: var(--bg);
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
}

.skip-link:hover {
  color: var(--bg);
}

/* ---------- Header ---------- */

.site-header {
  position: absolute;
  inset: 0 0 auto;
  z-index: 3;
  font-family: var(--font-mono);
  font-size: 14px;
}

.site-header__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0 24px;
  padding-block: 16px;
}

.logo,
.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  text-decoration: none;
  white-space: nowrap;
}

.logo {
  gap: 4px;
  font-weight: 500;
}

.logo__cursor {
  display: inline-block;
  width: 9px;
  height: 17px;
  background: var(--accent);
  animation: blink 1.1s steps(1) infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Logo and nav sit on two rows on small phones; keep the header height predictable. */
@media (max-width: 479px) {
  :root {
    --header-h: 120px;
  }

  .site-nav {
    flex-basis: 100%;
  }
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

.hero__art {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

.hero__svg,
.hero__canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  max-width: none;
}

.hero__canvas,
.hero__bh {
  transition: opacity 1.6s ease;
}

.hero__canvas {
  opacity: 0;
}

.hero.is-live .hero__canvas {
  opacity: 1;
}

.hero.is-live .hero__bh {
  opacity: 0;
}

/* Shade the art behind the text column so the copy keeps its contrast wherever the disk reaches. */
@media (min-width: 900px) {
  .hero__art::after {
    --col-end: calc(max(0px, (100% - var(--max)) / 2) + var(--gutter) + 600px);
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg,
      rgb(7 8 11 / 0.7) 0,
      rgb(7 8 11 / 0.55) calc(var(--col-end) - 140px),
      rgb(7 8 11 / 0) calc(var(--col-end) + 100px));
  }
}

.hero__inner {
  display: flex;
  flex-direction: column;
  min-height: 760px;
  padding-top: var(--header-h);
}

.hero__content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 660px;
  padding: 48px 0 64px;
}

.hero__eyebrow {
  margin-bottom: 24px;
}

.hero__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  /* "Taagaard" can't wrap and is ~7.6em wide; keep it inside the text column. */
  font-size: clamp(40px, 5.8vw, 96px);
  line-height: 0.95;
  letter-spacing: -0.03em;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 36px;
}

.hero__foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  padding: 20px 0 24px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
}

/*
  Narrow screens: scale the artwork down, dim it, and pin the black hole's centre (--bx, --by)
  where the disk stays clear of the copy. 1000/380 is the centre in the SVG's 1440×760 viewBox;
  hero.js reads the drawn position, so the live canvas follows.
*/
@media (max-width: 899px) {
  .hero__art {
    opacity: 0.6;
  }

  .hero__svg {
    --s: 0.66;
    --bx: calc(100% - 110px);
    --by: 50%;
    top: calc(var(--by) - 380px * var(--s));
    left: calc(var(--bx) - 1000px * var(--s));
    width: calc(1440px * var(--s));
    height: calc(760px * var(--s));
  }

  /* Tablets: copy on the left, black hole on the right. */
  .hero__content {
    max-width: min(660px, 56%);
  }
}

/* Phones: the black hole sits in a band above the copy, top-right. */
@media (max-width: 599px) {
  .hero__art {
    --live-scale: 0.8;
    opacity: 0.5;
  }

  .hero__svg {
    --s: 0.6;
    --bx: calc(100% - 64px);
    --by: calc(var(--header-h) + 36px);
  }

  .hero__content {
    max-width: none;
    justify-content: flex-start;
    padding-top: 116px;
  }

  .hero__title {
    font-size: clamp(36px, 11vw, 64px);
  }
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 14px;
  text-decoration: none;
  transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

.btn svg {
  flex: none;
}

.btn--primary {
  background: var(--accent);
  color: var(--bg);
  font-weight: 500;
}

.btn--primary:hover {
  background: var(--accent-hot);
  color: var(--bg);
}

.btn--ghost {
  border: 1px solid var(--line-strong);
  background: rgb(7 8 11 / 0.6);
}

.btn--ghost:hover {
  border-color: var(--accent);
}

/* ---------- Projects ---------- */

.work {
  padding-top: var(--section-y);
  padding-bottom: clamp(40px, 5vw, 64px);
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px 32px;
  margin-bottom: 40px;
}

.section-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(36px, 4.5vw, 64px);
  line-height: 1;
  letter-spacing: -0.02em;
}

.section-note {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted);
}

.section-tools {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}

/* Filter flags: one pressed at a time, styled like command-line options. */
.flags {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.flags[hidden] {
  display: none;
}

.flag {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 13px;
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

.flag:hover {
  border-color: var(--muted);
  color: var(--text);
}

.flag[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--bg);
}

@media (max-width: 599px) {
  .section-tools {
    align-items: flex-start;
  }

  .flags {
    justify-content: flex-start;
  }
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr));
  gap: 1px;
  padding: 1px;
}

/* Each card draws its own share of the grid lines, so a short last row leaves no filled gap. */
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 24px;
  background: var(--bg);
  box-shadow: 0 0 0 1px var(--line);
  transition: background-color 0.25s;
}

.card[hidden] {
  display: none;
}

.card:hover {
  background: var(--bg-raised);
}

.card__meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
}

.card__kinds {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 4px 10px;
}

.tag {
  padding: 2px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  line-height: 1.4;
  color: var(--text-soft);
}

.tag--vibe {
  border-color: rgb(255 181 71 / 0.4);
  color: var(--accent);
}

.cards-legend {
  margin: 16px 0 0;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
}

.card__preview {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
}

.card__preview svg,
.card__preview img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.card__preview img {
  object-fit: cover;
  object-position: top center;
  filter: saturate(0.85) brightness(0.92);
  transition: transform 0.5s ease, filter 0.3s;
}

.card:hover .card__preview img {
  filter: none;
  transform: scale(1.03);
}

.card__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 26px;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.card__desc {
  margin: 0;
  font-size: 15px;
  line-height: 1.55;
  color: var(--muted);
}

.card__link {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: var(--tap);
  margin-top: auto;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent);
  text-decoration: none;
}

/* The whole card is clickable; the link stays the one focusable element. */
.card__link::after {
  content: "";
  position: absolute;
  inset: 0;
}

.card__link span {
  transition: transform 0.2s;
}

.card:hover .card__link {
  color: var(--accent-hot);
}

.card:hover .card__link span {
  transform: translateX(3px);
}

@supports selector(:has(*)) {
  .card:has(.card__link:focus-visible) {
    outline: 2px solid var(--accent);
    outline-offset: -2px;
  }

  .card__link:focus-visible {
    outline: none;
  }
}

/* ---------- Friends ---------- */

.friends {
  padding-bottom: var(--section-y);
}

.friends__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 28px;
  padding-block: 10px;
  border-block: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 14px;
}

.friends__prompt {
  color: var(--muted);
}

.friends__list {
  display: flex;
  flex-wrap: wrap;
  gap: 0 28px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.friends__list a {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  text-underline-offset: 4px;
  text-decoration-color: var(--line-strong);
}

.friends__list a:hover {
  text-decoration-color: currentColor;
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--line);
}

.site-footer__inner {
  padding-top: var(--section-y);
  padding-bottom: 24px;
}

.site-footer__eyebrow {
  margin-bottom: 20px;
}

.say-hello {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(56px, 9vw, 140px);
  line-height: 0.95;
  letter-spacing: -0.03em;
}

.say-hello a {
  display: inline-block;
  text-decoration: none;
}

.site-footer__email {
  margin: 20px 0 0;
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--muted);
}

.site-footer__email a {
  color: inherit;
  text-underline-offset: 4px;
  text-decoration-color: var(--line-strong);
}

.site-footer__email a:hover {
  color: var(--accent);
}

.site-footer__bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 4px 24px;
  min-height: var(--tap);
  margin-top: var(--section-y);
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
}

.site-footer__bar a {
  display: inline-flex;
  align-items: center;
  gap: 0.6ch;
  min-height: var(--tap);
  color: var(--muted);
  text-decoration: none;
}

.site-footer__bar a:hover {
  color: var(--accent);
}

/* ---------- Motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
