/* Shared styles for every page. Colours follow the KnicKnaX logo: pink, purple, blue. */

:root {
  --bg: #fffaf3;
  --surface: #ffffff;
  --text: #1a1a1a;
  --muted: #5f5a66;
  --line: #efe5d8;
  /* the logo's three colours; the -text versions are darker so small text stays readable */
  --pink: #ff4f8b;
  --purple: #8b5cf6;
  --blue: #3a5bd9;
  --pink-text: #d6336c;
  --purple-text: #7c3aed;
  --blue-text: #3a5bd9;
  --pink-soft: #ffe3ed;
  --purple-soft: #efe7ff;
  --blue-soft: #e3e9ff;
  --max: 1040px;
  --font: "Raleway", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141218;
    --surface: #1e1b24;
    --text: #f6f1ea;
    --muted: #b5adbf;
    --line: #2f2a38;
    --pink-text: #ff6b9d;
    --purple-text: #b69cff;
    --blue-text: #8aa2ff;
    --pink-soft: #3a1f2c;
    --purple-soft: #2a2142;
    --blue-soft: #1d2647;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  /* Raleway's default numbers dip below the line; use regular ones */
  font-variant-numeric: lining-nums;
  font-weight: 500;  /* Raleway's regular weight is thin, medium reads better */
  font-size: 17px;
  line-height: 1.6;
}
a { color: var(--purple-text); }
img { max-width: 100%; display: block; }
/* keeps tilted cards and photos from making the page scroll sideways */
main { overflow-x: clip; }
.wrap { max-width: var(--max); margin: 0 auto; padding-left: 20px; padding-right: 20px; }

/* Header and navigation, with a pink-purple-blue stripe underneath */
header {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 4px solid;
  border-image: linear-gradient(90deg, var(--pink), var(--purple), var(--blue)) 1;
}
header .wrap { display: flex; align-items: center; justify-content: space-between; height: 80px; }
.logo { display: block; }
.logo img { height: 56px; width: auto; }
nav { white-space: nowrap; }
nav a { margin-left: 22px; text-decoration: none; color: var(--muted); font-size: 15px; font-weight: 600; padding: 4px 0; }
nav a:hover { color: var(--pink-text); }
nav a[aria-current="page"] { color: var(--text); border-bottom: 3px solid var(--pink); }

/* Page headings */
h1, h2, h3 { font-weight: 800; letter-spacing: -0.01em; }
.hero { padding-top: 88px; padding-bottom: 72px; }
.page-head { padding-top: 72px; padding-bottom: 40px; }
.eyebrow { color: var(--blue-text); font-weight: 700; font-size: 15px; letter-spacing: .02em; margin: 0 0 12px; }
h1 { font-size: clamp(2.4rem, 6vw, 4rem); line-height: 1.05; margin: 0 0 20px; max-width: 18ch; }
.k-pink { color: var(--pink-text); }
.k-purple { color: var(--purple-text); }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 56ch; margin: 0 0 32px; }
.page-head .lead { margin-bottom: 0; }

/* Dictionary-style line under the home page heading */
.definition { font-size: 1.25rem; line-height: 1.5; max-width: 40ch; margin: -4px 0 28px; }
.definition span { color: var(--muted); }

/* Buttons: chunky pills with a little offset shadow */
.buttons { display: flex; flex-wrap: wrap; gap: 14px; }
.btn {
  display: inline-block; padding: 11px 22px; border-radius: 999px;
  font-weight: 700; font-size: 15px; text-decoration: none;
  color: var(--text); border: 2px solid var(--text);
  box-shadow: 3px 3px 0 var(--text);
  transition: transform .12s ease, box-shadow .12s ease;
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--text); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--text); }
.btn-primary { background: var(--pink); color: #1a1a1a; }
.btn-ghost { background: var(--surface); }

/* Sections */
section { padding: 64px 0; border-top: 1px solid var(--line); }
h2 { font-size: 1.8rem; margin: 0 0 8px; }
.section-intro { color: var(--muted); margin: 0 0 36px; max-width: 60ch; }
.section-foot { margin-top: 32px; }

/* Featured work cards (home page) */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 24px; }
.card {
  background: var(--surface); border: 2px solid var(--line); border-radius: 18px;
  overflow: hidden; display: flex; flex-direction: column;
  transition: transform .15s ease;
}
.card:hover { transform: rotate(-0.6deg) translateY(-3px); }
.card:nth-child(even):hover { transform: rotate(0.6deg) translateY(-3px); }
.thumb { aspect-ratio: 16 / 9; display: grid; place-items: center; font-size: 14px; font-weight: 600; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 20px 22px 24px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card h3 { margin: 0; font-size: 1.25rem; }
.card p { margin: 0; color: var(--muted); font-size: 15px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 6px; }
.tag { font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--purple-soft); color: var(--text); }

/* Placeholders cycle through the three colours */
.card:nth-child(3n+1) .thumb, .gallery figure:nth-child(3n+1) .placeholder { background: var(--pink-soft); color: var(--pink-text); }
.card:nth-child(3n+2) .thumb, .gallery figure:nth-child(3n+2) .placeholder { background: var(--purple-soft); color: var(--purple-text); }
.card:nth-child(3n) .thumb, .gallery figure:nth-child(3n) .placeholder { background: var(--blue-soft); color: var(--blue-text); }

/* Gallery page */
.gallery { columns: 3 260px; column-gap: 20px; }
.gallery figure {
  break-inside: avoid; margin: 0 0 20px;
  background: var(--surface); border: 2px solid var(--line); border-radius: 18px; overflow: hidden;
}
.gallery img { width: 100%; height: auto; cursor: zoom-in; }
.gallery .placeholder { display: grid; place-items: center; font-size: 14px; font-weight: 600; }
.gallery figcaption { padding: 12px 16px 14px; font-size: 14px; color: var(--muted); }
.gallery figcaption strong { display: block; color: var(--text); font-size: 15px; }

/* Gallery lightbox */
.lightbox { border: 0; padding: 0; background: transparent; max-width: 92vw; max-height: 92vh; }
.lightbox::backdrop { background: rgba(20, 18, 24, .9); }
.lightbox img { max-width: 92vw; max-height: 82vh; border-radius: 12px; margin: 0 auto; }
.lightbox p { color: #fff; text-align: center; margin: 12px 0 0; font-size: 15px; }
.lightbox button {
  position: fixed; top: 16px; right: 20px;
  background: none; border: 0; color: #fff; font-size: 32px; line-height: 1; cursor: pointer;
}

/* About page */
.about { display: grid; grid-template-columns: 1.4fr 1fr; gap: 48px; }
.about p { margin: 0 0 16px; }
.portrait {
  aspect-ratio: 4 / 5; background: var(--purple-soft); color: var(--purple-text);
  border-radius: 18px; display: grid; place-items: center; font-size: 14px; font-weight: 600; overflow: hidden;
  transform: rotate(1.5deg);
}
.portrait img { width: 100%; height: 100%; object-fit: cover; }
.skills { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.skills li { padding: 12px 16px; background: var(--surface); border: 2px solid var(--line); border-left: 6px solid var(--pink); border-radius: 10px; font-size: 15px; }
.skills li:nth-child(3n+2) { border-left-color: var(--purple); }
.skills li:nth-child(3n) { border-left-color: var(--blue); }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { padding: 16px 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 140px 1fr; gap: 20px; }
.timeline li:last-child { border-bottom: 0; }
.timeline .when { color: var(--muted); font-size: 15px; }
.timeline h3 { margin: 0 0 4px; font-size: 1.1rem; }
.timeline p { margin: 0; color: var(--muted); font-size: 15px; }

/* Footer with contact on every page */
footer { padding: 48px 0; border-top: 1px solid var(--line); }
footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 20px; }
footer .contact-links { display: flex; flex-wrap: wrap; gap: 12px; }
footer small { color: var(--muted); font-size: 14px; }

@media (max-width: 720px) {
  header .wrap { height: 64px; }
  .logo img { height: 36px; }
  nav a { margin-left: 12px; font-size: 14px; }
  .hero { padding-top: 56px; padding-bottom: 48px; }
  .page-head { padding-top: 48px; padding-bottom: 28px; }
  .about { grid-template-columns: 1fr; gap: 28px; }
  .portrait { max-width: 320px; }
  .grid { grid-template-columns: 1fr; }
  .timeline li { grid-template-columns: 1fr; gap: 4px; }
}
