/* leonmatschke.com homepage: bento layout */

@font-face { font-family: "Cal Sans"; src: url("/fonts/calsans-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Geist"; src: url("/fonts/geist-var.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }

:root {
  --bg: #121211;
  --tile: #191918;
  --tile-2: #1e1e1c;
  --line: rgba(255, 255, 255, 0.075);
  --line-2: rgba(255, 255, 255, 0.14);
  --ink: #f1efea;
  --ink-2: rgba(241, 239, 234, 0.72);
  --ink-3: rgba(241, 239, 234, 0.5);
  --gold: #d2b37a;
  --gold-2: rgba(210, 179, 122, 0.4);
  --r: 22px;
  --r-in: 14px;
  --r-btn: 10px;
  --r-sm: 8px;
  --gap: 12px;
  --pad: clamp(22px, 2vw, 34px);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --ease-enter: cubic-bezier(.22, 1, .36, 1);
  --display: "Cal Sans", "Geist", ui-sans-serif, system-ui, sans-serif;
  --text: "Geist", ui-sans-serif, system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--bg); color-scheme: dark; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.5 var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
h1, h2, p, ul, figure { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

/* ---------- grid ---------- */

.bento {
  display: grid;
  gap: var(--gap);
  padding: var(--gap);
  margin: 0 auto;
  max-width: 1720px;
  grid-template-columns: 1fr;
}

.tile {
  position: relative;
  border-radius: var(--r);
  background: var(--tile);
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.045);
  min-width: 0;
}

/* ---------- intro ---------- */

.tile--intro {
  display: flex;
  flex-direction: column;
  padding: var(--pad);
  overflow: hidden;
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(255, 255, 255, 0.045) 0%, rgba(255, 255, 255, 0) 55%),
    var(--tile);
}
.intro-name {
  display: flex;
  align-items: center;
  gap: 12px;
  font: 400 15px/1 var(--display);
  letter-spacing: 0.02em;
  word-spacing: 0.08em;
  color: var(--ink-2);
}
.intro-mark { width: 30px; height: auto; color: var(--ink); }
.intro-title {
  margin-top: clamp(22px, 4.2vh, 48px);
  max-width: 13.5em;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(40px, 10.5vw, 56px);
  line-height: 1.02;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-wrap: balance;
}

.social { display: flex; gap: 8px; margin-top: clamp(18px, 3vh, 30px); }
.social-link {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-2);
  color: var(--ink-2);
  transition: color 150ms var(--ease), border-color 150ms var(--ease), background-color 150ms var(--ease), transform 150ms var(--ease);
}

.intro-foot {
  margin-top: auto;
  padding-top: clamp(24px, 3vh, 36px);
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px 28px;
}
.signature {
  height: 46px;
  width: auto;
  max-width: 100%;
  overflow: visible;
  margin: 0 0 2px;
}
.signature-ink path { fill: var(--gold); }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 22px;
  border-radius: var(--r-btn);
  font: 500 15px/1 var(--text);
  letter-spacing: 0;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 150ms var(--ease), border-color 150ms var(--ease), color 150ms var(--ease), transform 150ms var(--ease);
}
.btn--solid { background: var(--ink); color: #121211; border: 0; }
.btn--ghost {
  min-height: 40px;
  padding: 0 16px;
  font-size: 14px;
  border: 1px solid var(--line-2);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--r-sm);
}
.arrow { transition: transform 150ms var(--ease); }

/* ---------- photo ---------- */

.tile--photo { overflow: hidden; aspect-ratio: 4 / 5; background: #1a1918; }
.tile--photo picture, .tile--photo img { width: 100%; height: 100%; }
.tile--photo img { object-fit: cover; object-position: 38% 40%; }
.tile--photo::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  pointer-events: none;
}

/* ---------- cards ---------- */

.card {
  display: flex;
  flex-direction: column;
  padding: 8px;
  transition: transform 180ms var(--ease), border-color 180ms var(--ease), box-shadow 180ms var(--ease);
}
.art {
  position: relative;
  height: 190px;
  border-radius: var(--r-in);
  overflow: hidden;
  background:
    radial-gradient(90% 120% at 50% 0%, #2c2b28 0%, #222120 45%, #1c1b1a 100%);
  color: var(--ink);
}
.art::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}
.art svg { width: 100%; height: 100%; }
.card-body { display: contents; }
.card-title {
  padding: 18px 16px 0;
  font: 400 19px/1.2 var(--display);
  letter-spacing: 0.01em;
  word-spacing: 0.08em;
  color: var(--ink);
  text-wrap: balance;
}
.card-text {
  padding: 6px 16px 0;
  font-size: 15px;
  line-height: 1.45;
  color: var(--ink-2);
}
.card .btn { align-self: flex-start; margin: 16px 16px 12px; }

/* art strokes */
.art-laurel path { fill: none; stroke: rgba(255, 255, 255, 0.5); stroke-width: 1; vector-effect: non-scaling-stroke; transition: stroke 300ms var(--ease); }
.art-ring { fill: none; stroke: var(--gold-2); stroke-width: 1.1; }

.art-frame { fill: rgba(255, 255, 255, 0.02); stroke: rgba(255, 255, 255, 0.2); stroke-width: 1; }
.yt-logo-body { fill: rgba(255, 255, 255, 0.9); }
.yt-logo-play { fill: #222120; }
.yt-search, .yt-banner, .yt-thumb { fill: rgba(255, 255, 255, 0.025); stroke: rgba(255, 255, 255, 0.22); stroke-width: 1; }
.yt-thumb { transition: fill 300ms var(--ease), stroke 300ms var(--ease); }
.yt-avatar { fill: rgba(255, 255, 255, 0.04); stroke: rgba(255, 255, 255, 0.5); stroke-width: 1; }
.yt-name { fill: rgba(255, 255, 255, 0.6); }
.yt-meta { fill: rgba(255, 255, 255, 0.22); }
.yt-sub { fill: rgba(241, 239, 234, 0.92); }
.yt-sub-label { font: 500 7px var(--text); fill: #121211; letter-spacing: 0.01em; }
.yt-line { stroke: rgba(255, 255, 255, 0.35); stroke-width: 3; stroke-linecap: round; }
.yt-line--2 { stroke: rgba(255, 255, 255, 0.15); }

.art-halo { fill: none; stroke: rgba(255, 255, 255, 0.06); stroke-width: 1; }
.art-orb { fill: rgba(255, 255, 255, 0.025); stroke: rgba(255, 255, 255, 0.5); stroke-width: 1.2; }
.art-lens { stroke: var(--gold-2); stroke-width: 1.2; transition: opacity 300ms var(--ease); }
.art-node { fill: rgba(255, 255, 255, 0.75); }

/* ---------- hover (fine pointers) ---------- */

@media (hover: hover) and (pointer: fine) {
  .btn--solid:hover { background: #d9d6cf; transform: translateY(-1px); }
  .btn:active { transform: translateY(1px) scale(.985); transition-duration: 90ms; }
  .social-link:hover { color: var(--ink); border-color: rgba(255, 255, 255, 0.3); background: rgba(255, 255, 255, 0.04); transform: translateY(-1px); }
  .card:hover { transform: translateY(-2px); border-color: rgba(255, 255, 255, 0.13); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.045), 0 18px 40px -24px rgba(0, 0, 0, 0.6); }
  .card:hover .btn--ghost { background: rgba(255, 255, 255, 0.07); border-color: rgba(255, 255, 255, 0.24); }
  .card:hover .arrow { transform: translate(2px, -2px); }
  .card[href^="/"]:hover .arrow { transform: translateX(3px); }
  .card:hover .art-laurel path { stroke: rgba(255, 255, 255, 0.75); }
  .card:hover .yt-thumb { fill: rgba(255, 255, 255, 0.06); stroke: rgba(255, 255, 255, 0.34); }
  .card:hover .art-lens { animation: pulse 1.6s var(--ease) infinite; }
}
.card:focus-visible { outline-offset: 2px; }

@keyframes pulse { 0% { opacity: 1; } 50% { opacity: .35; } 100% { opacity: 1; } }

/* ---------- entrance (once, on load) ---------- */

.js .tile { animation: tile-in 800ms var(--ease-enter) both; animation-delay: calc(var(--i, 0) * 70ms + 60ms); }
@keyframes tile-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.js .signature {
  -webkit-mask-image: linear-gradient(90deg, #000 40%, transparent 60%);
  mask-image: linear-gradient(90deg, #000 40%, transparent 60%);
  -webkit-mask-size: 260% 100%;
  mask-size: 260% 100%;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: 100% 0;
  mask-position: 100% 0;
  animation: sign 1500ms cubic-bezier(.45, .05, .35, 1) 650ms forwards;
}
@keyframes sign { to { -webkit-mask-position: 0 0; mask-position: 0 0; } }

@media (prefers-reduced-motion: reduce) {
  .js .tile, .js .signature { animation: none; }
  .js .signature { -webkit-mask-image: none; mask-image: none; }
  .card, .btn, .social-link, .arrow { transition: none; }
  .card:hover .art-lens { animation: none; }
}

/* ---------- tablet ---------- */

@media (min-width: 680px) {
  .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 16px; }
  .tile--intro { grid-column: 1 / -1; min-height: 440px; }
  .intro-title { font-size: clamp(48px, 7vw, 64px); }
  .tile--photo { grid-row: span 2; aspect-ratio: auto; }
  .card:last-child { grid-column: 1 / -1; }
}

/* ---------- desktop: everything on one screen ---------- */

@media (min-width: 1024px) and (min-height: 620px) {
  html, body { height: 100%; }
  body { overflow: hidden; }
  .bento {
    height: 100vh;
    height: 100dvh;
    padding: clamp(12px, 1.4vw, 22px);
    gap: clamp(10px, 0.9vw, 14px);
    grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(0, 0.94fr);
    grid-template-rows: minmax(max-content, 1.9fr) minmax(110px, 1fr) auto auto auto;
  }
  .tile--intro { grid-column: 1 / 4; grid-row: 1; min-height: 0; }
  .intro-title { font-size: clamp(48px, min(5.3vw, 8.6vh), 96px); margin-top: clamp(20px, 4.4vh, 60px); }
  .tile--photo { grid-column: 4; grid-row: 1 / -1; aspect-ratio: auto; }
  .card, .card:last-child {
    grid-column: auto;
    grid-row: 2 / span 4;
    display: grid;
    grid-template-rows: subgrid;
    row-gap: 0;
  }
  .art { height: auto; min-height: 0; }
  .card-title { align-self: start; }
  .card-text { align-self: start; }
  .card .btn { align-self: end; justify-self: start; }
  .signature { height: clamp(44px, 6.4vh, 70px); }
}

@media (min-width: 1024px) and (min-height: 620px) and (max-height: 820px) {
  .card-title { padding-top: 14px; font-size: 18px; }
  .card-text { font-size: 14px; }
  .card .btn { margin-top: 12px; margin-bottom: 8px; }
}

/* ---------- contact popup ---------- */

.contact {
  padding: 16px;
  border: 0;
  background: transparent;
  max-width: 100vw;
  max-height: 100dvh;
  width: 100%;
  height: 100%;
  color: var(--ink);
}
.contact[open] { display: grid; place-items: center; }
.contact::backdrop { background: rgba(8, 8, 7, 0.66); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.contact[open]::backdrop { animation: fade-in 220ms var(--ease) both; }
.contact.is-closing::backdrop { animation: fade-out 160ms var(--ease) both; }
html.contact-open { overflow: hidden; }

.contact-card {
  position: relative;
  width: min(460px, 100%);
  max-height: calc(100dvh - 32px);
  overflow: auto;
  padding: 32px;
  border-radius: var(--r);
  background: #1b1b19;
  border: 1px solid var(--line-2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 30px 80px -30px rgba(0, 0, 0, 0.8);
  animation: card-in 260ms var(--ease-enter) both;
}
.contact.is-closing .contact-card { animation: card-out 160ms var(--ease) both; }
@keyframes card-in { from { opacity: 0; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes card-out { to { opacity: 0; transform: translateY(6px) scale(.985); } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }

.contact-close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--ink-3);
  cursor: pointer;
  transition: color 150ms var(--ease), background-color 150ms var(--ease);
}
.contact-close:hover { color: var(--ink); background: rgba(255, 255, 255, 0.06); }
.contact-title { font: 400 28px/1.1 var(--display); letter-spacing: -0.01em; padding-right: 40px; }
.contact-sub { margin-top: 8px; color: var(--ink-2); font-size: 15px; }
.contact-form { margin-top: 24px; display: grid; gap: 16px; }
.field { display: grid; gap: 8px; }
.field label { font-size: 13px; font-weight: 500; color: var(--ink-2); }
.field input, .field textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--r-btn);
  border: 1px solid var(--line-2);
  background: #141413;
  color: var(--ink);
  font: 400 16px/1.45 var(--text);
  transition: border-color 150ms var(--ease), box-shadow 150ms var(--ease);
}
.field textarea { resize: vertical; min-height: 120px; }
.field input::placeholder, .field textarea::placeholder { color: rgba(241, 239, 234, 0.32); }
.field input:focus, .field textarea:focus { outline: none; border-color: rgba(255, 255, 255, 0.38); box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.06); }
.field [aria-invalid="true"] { border-color: #d9826f; }
.field-error { font-size: 13px; color: #e59a88; }
.contact-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.contact-error { font-size: 14px; color: #e59a88; }
.contact-error a { text-decoration: underline; text-underline-offset: 3px; }
.contact-send { width: 100%; position: relative; margin-top: 4px; }
.contact-done .contact-send { margin-top: 24px; }
.contact-spinner {
  display: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(18, 18, 17, 0.25);
  border-top-color: #121211;
  animation: spin 700ms linear infinite;
}
.contact-send.is-loading .contact-send-label { opacity: 0.6; }
.contact-send.is-loading .contact-spinner { display: inline-block; }
.contact-send:disabled { cursor: progress; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 520px) {
  .contact { padding: 10px; }
  .contact-card { padding: 26px 22px 22px; }
}
@media (prefers-reduced-motion: reduce) {
  .contact-card, .contact[open]::backdrop { animation: none; }
}

@media (min-width: 1600px) and (min-height: 860px) {
  .intro-name { font-size: 17px; }
  .intro-mark { width: 34px; }
  .social-link { width: 48px; height: 48px; }
  .btn { min-height: 52px; padding: 0 26px; font-size: 16px; }
  .btn--ghost { min-height: 44px; padding: 0 18px; font-size: 15px; }
  .card { padding: 10px; }
  .card-title { padding: 22px 18px 0; font-size: 23px; }
  .card-text { padding: 8px 18px 0; font-size: 16px; }
  .card .btn { margin: 18px 18px 14px; }
}
