/* ---------------------------------------------------------------
   Alex Madrzyk — personal site
   Clean white "paper" aesthetic
----------------------------------------------------------------- */

/* ---------- Recoleta (custom font) ---------- */
@font-face {
  font-family: 'Recoleta';
  src: local('Recoleta Thin'), local('Recoleta-Thin'),
    url('public/fonts/recoleta/Recoleta-Thin.woff2') format('woff2'),
    url('public/fonts/recoleta/Recoleta-Thin.woff') format('woff'),
    url('public/fonts/recoleta/Recoleta-Thin.ttf') format('truetype');
  font-weight: 100;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Recoleta';
  src: local('Recoleta Light'), local('Recoleta-Light'),
    url('public/fonts/recoleta/Recoleta-Light.woff2') format('woff2'),
    url('public/fonts/recoleta/Recoleta-Light.woff') format('woff'),
    url('public/fonts/recoleta/Recoleta-Light.ttf') format('truetype');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Recoleta';
  src: local('Recoleta Regular'), local('Recoleta-Regular'),
    url('public/fonts/recoleta/Recoleta-Regular.woff2') format('woff2'),
    url('public/fonts/recoleta/Recoleta-Regular.woff') format('woff'),
    url('public/fonts/recoleta/Recoleta-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Recoleta';
  src: local('Recoleta Medium'), local('Recoleta-Medium'),
    url('public/fonts/recoleta/Recoleta-Medium.woff2') format('woff2'),
    url('public/fonts/recoleta/Recoleta-Medium.woff') format('woff'),
    url('public/fonts/recoleta/Recoleta-Medium.ttf') format('truetype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Recoleta';
  src: local('Recoleta SemiBold'), local('Recoleta-SemiBold'),
    url('public/fonts/recoleta/Recoleta-SemiBold.woff2') format('woff2'),
    url('public/fonts/recoleta/Recoleta-SemiBold.woff') format('woff'),
    url('public/fonts/recoleta/Recoleta-SemiBold.ttf') format('truetype');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Recoleta';
  src: local('Recoleta Bold'), local('Recoleta-Bold'),
    url('public/fonts/recoleta/Recoleta-Bold.woff2') format('woff2'),
    url('public/fonts/recoleta/Recoleta-Bold.woff') format('woff'),
    url('public/fonts/recoleta/Recoleta-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Recoleta';
  src: local('Recoleta Black'), local('Recoleta-Black'),
    url('public/fonts/recoleta/Recoleta-Black.woff2') format('woff2'),
    url('public/fonts/recoleta/Recoleta-Black.woff') format('woff'),
    url('public/fonts/recoleta/Recoleta-Black.ttf') format('truetype');
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #f7f6f3;          /* soft paper */
  --surface: #ffffff;     /* sheet */
  --surface-2: #f1efea;   /* faint fill */
  --text: #1b1a18;        /* ink */
  --muted: #5c574f;
  --faint: #9b948a;
  --accent: #1b1a18;      /* ink accent */
  --accent-soft: #3a3833;
  --border: #e7e3da;
  --line: #ddd8cd;
  --shadow: 0 1px 2px rgba(27, 26, 24, 0.04), 0 6px 22px rgba(27, 26, 24, 0.05);
  --shadow-hover: 0 2px 6px rgba(27, 26, 24, 0.06), 0 16px 38px rgba(27, 26, 24, 0.10);
  --radius: 16px;
  --radius-sm: 10px;
  --maxw: 1080px;
  --font-sans: "Recoleta", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-display: "Recoleta", Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* Form controls don't inherit font by default — make them use Recoleta too */
button, input, select, textarea { font-family: inherit; }

html { scroll-behavior: smooth; scroll-padding-top: 84px; }

body {
  font-family: var(--font-sans);
  color: var(--text);
  line-height: 1.65;
  font-size: 17px;
  font-weight: 500;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* Real paper: warm off-white base + tiled paper-texture photo */
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 20% 10%, rgba(255, 253, 247, 0.5) 0%, rgba(255, 253, 247, 0) 55%),
    radial-gradient(circle at 85% 90%, rgba(226, 217, 199, 0.45) 0%, rgba(226, 217, 199, 0) 55%),
    url("public/paper-textures/01-white-papers.jpg");
  background-repeat: no-repeat, no-repeat, repeat;
  background-size: auto, auto, 600px auto;
  background-attachment: fixed, fixed, scroll;
  background-blend-mode: normal, normal, multiply;
}

a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; text-decoration-color: var(--line); }
a:hover { text-decoration-color: currentColor; }

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

::selection { background: #1b1a18; color: #fff; }

/* ---------- Navigation ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease;
}
.nav.is-scrolled { border-bottom-color: var(--border); }

.nav__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.nav__brand {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--text);
  letter-spacing: -0.01em;
  white-space: nowrap;
  text-decoration: none;
}

.nav__links { display: flex; gap: 4px; }
.nav__links a {
  color: var(--accent-soft);
  font-size: 0.92rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
  text-decoration: none;
  /* faint light halo so dark text still separates over dark imagery */
  text-shadow: 0 0 6px color-mix(in srgb, var(--bg) 85%, transparent);
  transition: color 0.2s ease, background 0.2s ease;
}
.nav__links a:hover,
.nav__links a.is-active { color: var(--text); background: var(--surface-2); }

.nav__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 8px;
}
.nav__toggle span { width: 22px; height: 2px; background: var(--text); border-radius: 2px; }

/* ---------- Layout helpers ---------- */
.section { max-width: var(--maxw); margin: 0 auto; padding: 72px 24px; }
.section__head { margin-bottom: 36px; max-width: 660px; }
.section h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.7rem, 3.4vw, 2.4rem);
  letter-spacing: -0.02em;
  line-height: 1.12;
}
.section__sub { color: var(--muted); margin-top: 8px; font-size: 1.02rem; }

/* ---------- Hero ---------- */
.hero { max-width: var(--maxw); margin: 0 auto; padding: clamp(40px, 7vw, 88px) 24px clamp(28px, 4vw, 48px); }
.hero__grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: clamp(32px, 5vw, 64px);
  align-items: center;
}
.hero__badge {
  width: 56px; height: 56px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 18px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.eyebrow { font-weight: 600; color: var(--muted); margin-bottom: 14px; font-size: 1rem; }
.hero h1 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2rem, 5vw, 3.2rem);
  line-height: 1.08;
  letter-spacing: -0.025em;
  margin-bottom: 24px;
}
.hero__bio p { color: var(--muted); margin-bottom: 12px; font-size: 1.08rem; }
.hero__bio a { font-weight: 500; }

.hero__cta { display: flex; gap: 12px; margin-top: 28px; flex-wrap: wrap; }
.btn {
  display: inline-flex;
  align-items: center;
  font-weight: 500;
  font-size: 0.96rem;
  padding: 11px 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-soft); box-shadow: var(--shadow-hover); }
.btn--ghost { border-color: var(--line); color: var(--text); background: var(--surface); }
.btn--ghost:hover { border-color: var(--text); }

.hero__media { display: flex; flex-direction: column; gap: 10px; }
.hero__frame {
  width: 100%;
  /* Widget is transparent — let the paper show through (no card behind it) */
  background: transparent;
  border: 0;
  box-shadow: none;
  aspect-ratio: 1 / 1;
}
.hero__frame iframe { width: 100%; height: 100%; border: 0; display: block; }
.hero__frame-cap { color: var(--faint); font-size: 0.84rem; text-align: center; }

/* ---------- Find me on ---------- */
.links { list-style: none; display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.links a {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.links a:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); border-color: var(--line); }
.links__icon {
  width: 24px;
  height: 24px;
  flex: none;
  background-color: var(--accent-soft);
  -webkit-mask: var(--icon) center / contain no-repeat;
  mask: var(--icon) center / contain no-repeat;
  transition: background-color 0.2s ease;
}
.links a:hover .links__icon { background-color: var(--accent); }
.links__body { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.links__body strong { font-weight: 600; font-size: 0.98rem; }
.links__body span { color: var(--muted); font-size: 0.88rem; }
.links__arrow { color: var(--faint); font-size: 1.05rem; transition: transform 0.2s ease, color 0.2s ease; }
.links a:hover .links__arrow { color: var(--text); transform: translate(2px, -2px); }

/* ---------- Divider ---------- */
.divider { display: flex; align-items: center; justify-content: center; max-width: var(--maxw); margin: 8px auto; padding: 0 24px; }
.divider span {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.2rem;
  color: var(--muted);
  position: relative;
  padding: 0 22px;
}
.divider span::before, .divider span::after { content: ""; position: absolute; top: 50%; width: 64px; height: 1px; background: var(--line); }
.divider span::before { right: 100%; }
.divider span::after { left: 100%; }

/* ---------- Cards ---------- */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.cards--reads { grid-template-columns: repeat(2, 1fr); }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform 0.15s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.card h3 { font-family: var(--font-display); font-weight: 600; font-size: 1.22rem; letter-spacing: -0.01em; line-height: 1.2; }
.card time { color: var(--faint); font-size: 0.82rem; font-weight: 500; }
.card p { color: var(--muted); font-size: 0.96rem; }

/* Clickable media tiles (button reset) */
.card--tile {
  font: inherit;
  text-align: left;
  cursor: pointer;
  color: inherit;
  width: 100%;
}
.card--tile:hover { border-color: var(--line); }
.card--tile:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.card__cue {
  margin-top: auto;
  padding-top: 8px;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text);
  display: inline-flex;
  gap: 4px;
}
.card__cue span { transition: transform 0.2s ease; }
.card--tile:hover .card__cue span { transform: translateX(3px); }

/* Cover image inside a modal peek — show in full (no crop) */
.modal__cover {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 10px;
  margin: 4px 0 18px;
  background: var(--surface-2);
}
/* Smaller, centered cover for square artwork, so text stays visible */
.modal__cover--sm { max-width: 360px; margin-left: auto; margin-right: auto; }

/* ---------- Tags (neutral) ---------- */
.card__tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.tag {
  font-size: 0.74rem;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  border: 1px solid var(--border);
  letter-spacing: 0.01em;
}

/* ---------- Place labels (modeling) ---------- */
.place { font-weight: 600; margin: 24px 0 12px; font-size: 0.98rem; }
.place span { color: var(--muted); font-weight: 400; font-style: italic; }
.place__note { color: var(--faint); font-style: italic; margin: 6px 0 4px; }

/* ---------- Galleries ---------- */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.gallery__item {
  display: block;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface-2);
  cursor: zoom-in;
  border: 1px solid var(--border);
}
.gallery__item img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 3 / 4; transition: transform 0.4s ease; }
.gallery__item:hover img { transform: scale(1.04); }
.gallery__item--wide { grid-column: span 2; }
.gallery__item--wide img { aspect-ratio: 16 / 11; }

/* ---------- Photography ---------- */
.photo-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.photo { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.photo .gallery__item { border-radius: 0; border: 0; cursor: zoom-in; background: var(--surface-2); }
/* Show photos at their natural proportions (no crop/squish) */
.photo .gallery__item img { aspect-ratio: auto; width: 100%; height: auto; object-fit: contain; }
.photo figcaption { padding: 16px 18px; display: flex; flex-direction: column; gap: 8px; }
.photo figcaption strong { font-family: var(--font-display); font-weight: 600; font-size: 1.1rem; }
.photo figcaption > span { color: var(--faint); font-size: 0.84rem; }

/* ---------- Music ---------- */
.music-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
.embed { position: relative; border-radius: var(--radius); overflow: hidden; }
.embed--video { aspect-ratio: 16 / 9; background: #000; box-shadow: var(--shadow); }
.embed iframe { width: 100%; height: 100%; border: 0; display: block; }
.embed--spotify { min-height: 352px; }
.embed--spotify iframe { width: 100%; height: 352px; }

.past-tunes { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.past-tunes > h3 { font-family: var(--font-display); font-weight: 600; font-size: 1.2rem; margin-bottom: 18px; }
.past-tunes__item { margin-bottom: 22px; }
.past-tunes__item:last-child { margin-bottom: 0; }
.past-tunes__item time { display: block; color: var(--faint); font-size: 0.82rem; font-weight: 500; margin-bottom: 10px; }
.past-tunes .embed--spotify, .past-tunes .embed--spotify iframe { min-height: 152px; height: 152px; }
.muted { color: var(--muted); font-size: 0.92rem; margin-top: 10px; font-style: italic; }

/* Full-width playlist embed + Past tunes modal link */
.embed--full { width: 100%; }
.past-tunes-link {
  margin-top: 18px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  padding: 12px 22px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.past-tunes-link:hover { transform: translateY(-1px); box-shadow: var(--shadow-hover); border-color: var(--line); }
.past-tunes-link span { transition: transform 0.2s ease; }
.past-tunes-link:hover span { transform: translateX(3px); }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--border); text-align: center; padding: 40px 24px; color: var(--faint); font-size: 0.9rem; margin-top: 32px; }

/* ---------- Modal (Notion-style peek) ---------- */
.modal { position: fixed; inset: 0; z-index: 90; display: none; align-items: center; justify-content: center; padding: 24px; }
.modal.is-open { display: flex; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(27, 26, 24, 0.45); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); }
.modal__dialog {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-width: 760px;
  width: 100%;
  max-height: 88vh;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 36px;
  box-shadow: 0 24px 70px rgba(27, 26, 24, 0.28);
  animation: modalIn 0.2s ease;
  scrollbar-width: thin;                       /* Firefox */
  scrollbar-color: var(--line) transparent;
}
/* Slim, theme-matching scrollbar (WebKit/Chromium) */
.modal__dialog::-webkit-scrollbar { width: 8px; }
.modal__dialog::-webkit-scrollbar-track { background: transparent; }
.modal__dialog::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 999px;
  border: 2px solid var(--surface);
}
.modal__dialog::-webkit-scrollbar-thumb:hover { background: var(--faint); }
@keyframes modalIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.modal__close {
  position: absolute; top: 14px; right: 16px;
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 1.4rem; line-height: 1;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s ease, color 0.2s ease;
}
.modal__close:hover { background: var(--surface-2); color: var(--text); }
.modal__eyebrow { color: var(--faint); font-size: 0.82rem; font-weight: 500; letter-spacing: 0.02em; }
.modal__title { font-family: var(--font-display); font-weight: 600; font-size: 1.7rem; letter-spacing: -0.01em; margin: 6px 0 16px; }
.modal__content p { color: var(--muted); margin-bottom: 12px; }
.modal__content ul { margin: 4px 0 16px 1.2em; color: var(--muted); }
.modal__content ul li { margin-bottom: 4px; }
.modal__content .place:first-of-type { margin-top: 8px; }
.modal__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 120;
  background: rgba(20, 19, 17, 0.92);
  display: none; align-items: center; justify-content: center;
  padding: 32px; cursor: zoom-out;
}
.lightbox.is-open { display: flex; }
.lightbox img { max-width: 100%; max-height: 90vh; border-radius: 8px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5); }
.lightbox__close { position: absolute; top: 20px; right: 26px; background: none; border: 0; color: #fff; font-size: 2.4rem; line-height: 1; cursor: pointer; opacity: 0.85; }
.lightbox__close:hover { opacity: 1; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .nav__links {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 12px 24px 20px; gap: 4px;
    display: none;
  }
  .nav__links.is-open { display: flex; }
  .nav__links a { padding: 10px 12px; }
  .nav__toggle { display: flex; }

  .hero__grid { grid-template-columns: 1fr; }
  .hero__media { order: -1; }
  .hero__frame { max-width: 340px; margin: 0 auto; }

  .cards, .cards--reads { grid-template-columns: 1fr; }
  .links { grid-template-columns: 1fr; }
  .photo-grid { grid-template-columns: 1fr; }
  .music-grid { grid-template-columns: 1fr; }
  .gallery__item--wide { grid-column: span 1; }
  .gallery__item--wide img { aspect-ratio: 3 / 4; }
  .modal__dialog { padding: 28px 22px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}
