/* ========================================================
   Bento-style personal page — inspired by bento.me
   ======================================================== */

/* ---------- CSS Custom Properties ---------- */
:root {
  --font:          'Inter', system-ui, sans-serif;

  /* palette — artist's book / cream & light brown */
  --bg:            #f5f0e6;
  --card-radius:   22px;
  --card-shadow:   0 2px 16px rgba(60,40,20,.07), 0 1px 3px rgba(60,40,20,.05);
  --card-shadow-hover: 0 8px 32px rgba(60,40,20,.13), 0 2px 8px rgba(60,40,20,.08);

  /* card colours — warm earth tones */
  --clr-bio:       #f5ebe0;
  --clr-twitter:   #ede4d8;
  --clr-github:    #e8e0d4;
  --clr-now:       #f0e8d8;
  --clr-photo:     #ebe3d5;
  --clr-map:       #e5ddd0;
  --clr-music:     #f2e9dc;
  --clr-newsletter:#ede4d8;
  --clr-work:      #f0e5d5;
  --clr-website:   #e8e0d4;
  --clr-instagram: #f5ebe0;
  --clr-quote:     #ebe3d5;

  --text-primary:  #2c2419;
  --text-secondary:#6b5d4f;
  --text-muted:    #9a8d7f;

  /* grid */
  --col:  180px;
  --gap:  16px;

  /* parallax */
  --scroll: 0px;
}

/* ---------- Reset / Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }
img { display: block; max-width: 100%; }

/* ---------- Parallax Scene ---------- */
.parallax-scene {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.parallax-layer {
  position: absolute;
  inset: -20%;
  background-repeat: no-repeat;
  will-change: transform;
  opacity: .55;
}

.layer-far {
  background:
    radial-gradient(ellipse 60% 50% at 20% 20%, #d4c4a855 0%, transparent 70%),
    radial-gradient(ellipse 40% 60% at 80% 75%, #c9b89644 0%, transparent 70%);
  transform: translateY(calc(var(--scroll) * 0.15));
}

.layer-mid {
  background:
    radial-gradient(ellipse 50% 40% at 70% 20%, #e0d4be55 0%, transparent 65%),
    radial-gradient(ellipse 35% 55% at 15% 75%, #c4b89255 0%, transparent 65%);
  transform: translateY(calc(var(--scroll) * 0.30));
}

.layer-close {
  background:
    radial-gradient(ellipse 30% 30% at 50% 50%, #b8a88e44 0%, transparent 60%);
  transform: translateY(calc(var(--scroll) * 0.55));
}

/* ---------- Header ---------- */
.site-header {
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: 820px;
  margin: 48px auto 28px;
  padding: 0 24px;
  position: relative;
}

.profile-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  overflow: hidden;
  background: #ddd;
  flex-shrink: 0;
  border: 3px solid #fff;
  box-shadow: 0 2px 10px rgba(0,0,0,.10);
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-info h1 {
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.2;
}

.profile-info p {
  font-size: .875rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.cms-link {
  margin-left: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,.7);
  backdrop-filter: blur(6px);
  color: var(--text-muted);
  transition: color .2s, background .2s;
  flex-shrink: 0;
}

.cms-link:hover { color: var(--text-primary); background: rgba(255,255,255,.95); }

/* ---------- Bento Grid ---------- */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(4, var(--col));
  grid-auto-rows: var(--col);
  gap: var(--gap);
  max-width: 820px;
  margin: 0 auto 60px;
  padding: 0 24px;
}

/* ---------- Card Base ---------- */
.card {
  position: relative;
  border-radius: var(--card-radius);
  overflow: hidden;
  box-shadow: var(--card-shadow);
  transition:
    transform .28s cubic-bezier(.34,1.56,.64,1),
    box-shadow .28s ease;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
}

.card:hover {
  transform: translateY(-4px) scale(1.015);
  box-shadow: var(--card-shadow-hover);
  z-index: 10;
}

.card:focus-visible {
  outline: 3px solid #8b7355;
  outline-offset: 2px;
}

/* Grid sizing helpers */
.card--2x2 { grid-column: span 2; grid-row: span 2; }
.card--2x1 { grid-column: span 2; }
.card--1x2 { grid-row: span 2; }
.card--1x1 { /* default */ }

/* ---------- Card Background Image ---------- */
.card__bg-image {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  z-index: 0;
  border-radius: var(--card-radius);
  opacity: 0.25;
  transition: opacity .3s ease;
}

.card:hover .card__bg-image {
  opacity: 0.35;
}

.card--has-bg .card__inner {
  background: rgba(255,255,255,0.75);
  border-radius: var(--card-radius);
}

/* ---------- Card Inner ---------- */
.card__inner {
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  position: relative;
  z-index: 2;
}

.card__emoji { font-size: 2rem; line-height: 1; }
.card__title { font-size: 1.1rem; font-weight: 700; }
.card__title--sm { font-size: .95rem; font-weight: 600; margin-top: 2px; }
.card__text  { font-size: .83rem; line-height: 1.55; color: var(--text-secondary); }
.card__label { font-size: .72rem; font-weight: 500; text-transform: uppercase; letter-spacing: .07em; color: var(--text-muted); }
.card__handle { font-size: .82rem; font-weight: 600; margin-top: 2px; }

/* service icon */
.card__service-icon {
  display: flex;
  width: 32px;
  height: 32px;
  margin-bottom: 4px;
}
.card__service-icon svg { width: 100%; height: 100%; }

/* blob decorations */
.card__blob {
  position: absolute;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  bottom: -40px;
  right: -40px;
  opacity: .35;
  z-index: 1;
}
.blob--pink  { background: radial-gradient(circle, #c4a882, #d4b892); }
.blob--blue  { background: radial-gradient(circle, #b8a888, #c4b898); }

/* ---------- Individual Card Colours ---------- */
.card--bio        { background: var(--clr-bio); }
.card--twitter    { background: var(--clr-twitter); }
.card--github     { background: var(--clr-github); }
.card--now        { background: var(--clr-now); }
.card--photo      { background: var(--clr-photo); }
.card--map        { background: var(--clr-map); }
.card--music      { background: var(--clr-music); }
.card--newsletter { background: var(--clr-newsletter); }
.card--work       { background: var(--clr-work); }
.card--website    { background: var(--clr-website); }
.card--instagram  { background: var(--clr-instagram); }
.card--quote      { background: var(--clr-quote); }

/* ---------- Photo Card ---------- */
.card--photo .card__image-wrap {
  position: absolute;
  inset: 0;
}

.card--photo .card__image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s ease;
}

.card--photo:hover .card__image-wrap img { transform: scale(1.06); }

.card__photo-caption {
  position: absolute;
  bottom: 14px;
  left: 14px;
  background: rgba(0,0,0,.45);
  color: #fff;
  font-size: .75rem;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 999px;
  backdrop-filter: blur(4px);
  z-index: 3;
}

/* ---------- Map Card ---------- */
.card__map-pin {
  position: absolute;
  bottom: 18px;
  right: 18px;
  width: 36px;
  height: 36px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23e74c3c'%3E%3Cpath d='M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z'/%3E%3C/svg%3E") center/contain no-repeat;
  opacity: .6;
}

/* ---------- Quote Card ---------- */
.card--quote .card__inner { justify-content: center; align-items: flex-start; }
.card__quote-mark { font-size: 3rem; line-height: .8; color: #8b7355; opacity: .4; font-family: Georgia, serif; }
.card__quote-text { font-size: .82rem; font-style: italic; line-height: 1.5; }
.card__quote-author { font-size: .7rem; color: var(--text-muted); margin-top: 4px; }

/* ---------- Instagram gradient ---------- */
.card__service-icon--ig svg { fill: url(#ig-grad); }

/* ---------- Footer ---------- */
.site-footer {
  text-align: center;
  padding: 24px;
  color: var(--text-muted);
  font-size: .8rem;
}

.site-footer a {
  color: var(--text-secondary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ---------- Responsive ---------- */
@media (max-width: 780px) {
  :root {
    --col: calc((100vw - 72px) / 4);
    --gap: 12px;
  }

  .site-header { margin-top: 32px; }
}

@media (max-width: 540px) {
  :root {
    --col: calc((100vw - 56px) / 2);
    --gap: 10px;
  }

  .bento-grid { grid-template-columns: repeat(2, var(--col)); }

  .card--2x2 { grid-column: span 2; grid-row: span 2; }
  .card--2x1 { grid-column: span 2; }

  .site-header { margin-top: 24px; gap: 10px; }
  .profile-avatar { width: 50px; height: 50px; }
  .profile-info h1 { font-size: 1.1rem; }
}

/* ---------- Reduced-motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .card { transition: none; }
  .card--photo .card__image-wrap img { transition: none; }
  .parallax-layer { transform: none !important; }
}
