/* =========================================================
   Clean linktree — neutral grey/white/black, clear content, prominent links.
   System fonts only. No external resources.
   ========================================================= */

:root {
  --bg:        #f4f4f5;
  --bg-soft:   #e7e7ea;
  --card:      #ffffff;
  --ink:       #111113;
  --ink-soft:  #3f3f46;
  --muted:     #71717a;
  --border:    #d4d4d8;
  --accent:    #111113;   /* monochrome — ink itself */
  --accent-soft: #e4e4e7;
  --radius:    14px;
  --radius-sm: 10px;
  --shadow:    0 1px 2px rgba(29,26,22,.04), 0 4px 14px rgba(29,26,22,.05);
  --shadow-hover: 0 2px 4px rgba(29,26,22,.05), 0 10px 26px rgba(29,26,22,.09);
  --serif: "Iowan Old Style", "Apple Garamond", Garamond, "Hoefler Text", Georgia, "Times New Roman", serif;
  --sans:  -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
  --ease:  cubic-bezier(.2,.7,.2,1);
}

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

html {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100dvh;
  background:
    radial-gradient(800px 400px at 50% -10%, rgba(17,17,19,.05), transparent 70%),
    var(--bg);
}

a { color: inherit; text-decoration: none; }
ul, ol { margin: 0; padding: 0; list-style: none; }
::selection { background: var(--accent); color: #fff; }

/* ---------- Page container ---------- */
.page {
  max-width: 560px;
  margin: 0 auto;
  padding: 56px 20px 48px;
}

/* ---------- Hero ---------- */
.hero {
  text-align: center;
  margin-bottom: 32px;
  animation: rise .7s var(--ease) both;
}
.avatar {
  width: 88px; height: 88px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--bg);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 600;
  font-size: 34px;
  letter-spacing: -.02em;
  box-shadow: var(--shadow);
}
.name {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(32px, 6vw, 42px);
  letter-spacing: -.02em;
  line-height: 1.1;
  margin: 0 0 6px;
}
.handle {
  color: var(--muted);
  font-size: 14.5px;
  margin: 0 0 14px;
}
.tagline {
  color: var(--ink-soft);
  font-size: 16px;
  line-height: 1.5;
  max-width: 42ch;
  margin: 0 auto 14px;
}
.location {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 12px;
}
.pin { color: var(--accent); font-size: 10px; }

.quote {
  display: inline-block;
  font-family: var(--serif);
  font-style: italic;
  font-size: 14.5px;
  color: var(--ink-soft);
  background: var(--bg-soft);
  padding: 6px 14px;
  border-radius: 999px;
  margin: 6px 0 0;
  transition: opacity .4s var(--ease);
  max-width: 90%;
}
.quote.fade { opacity: 0; }
.quote:empty { display: none; }

/* ---------- Featured card ---------- */
.featured {
  position: relative;
  background: var(--ink);
  color: var(--bg);
  border-radius: var(--radius);
  padding: 22px 22px 22px;
  margin-bottom: 28px;
  box-shadow: var(--shadow);
  animation: rise .7s .05s var(--ease) both;
  overflow: hidden;
}
.featured__badge {
  position: absolute; top: 14px; right: 14px;
  background: var(--accent);
  color: #fff;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .15em;
  padding: 4px 8px;
  border-radius: 4px;
}
.featured__kicker {
  font-size: 11.5px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: rgba(246,241,231,.6);
  margin-bottom: 8px;
}
.featured__title {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: -.015em;
  margin: 0 0 8px;
  max-width: 22ch;
}
.featured__sub {
  font-size: 14.5px;
  color: rgba(246,241,231,.75);
  margin: 0 0 16px;
  line-height: 1.45;
}
.featured__cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  color: var(--ink);
  padding: 9px 14px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 600;
  transition: transform .2s var(--ease), background .2s var(--ease);
}
.featured__cta svg { width: 14px; height: 14px; transition: transform .25s var(--ease); }
.featured__cta:hover { background: #fff; transform: translateY(-1px); }
.featured__cta:hover svg { transform: translateX(3px); }

/* ---------- Main links (focal point) ---------- */
.links {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 36px;
}
.link {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 18px;
  box-shadow: var(--shadow);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .2s var(--ease);
  animation: rise .6s var(--ease) both;
}
.link:nth-child(1) { animation-delay: .10s; }
.link:nth-child(2) { animation-delay: .15s; }
.link:nth-child(3) { animation-delay: .20s; }
.link:nth-child(4) { animation-delay: .25s; }
.link:nth-child(5) { animation-delay: .30s; }
.link:nth-child(6) { animation-delay: .35s; }
.link:nth-child(7) { animation-delay: .40s; }
.link:nth-child(8) { animation-delay: .45s; }

.link:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  border-color: var(--accent);
}
.link__body {
  flex: 1;
  min-width: 0;
}
.link__label {
  display: block;
  font-size: 16.5px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.3;
}
.link__sub {
  display: block;
  font-size: 13.5px;
  color: var(--muted);
  margin-top: 2px;
}
.link__arrow {
  flex-shrink: 0;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted);
  transition: color .2s var(--ease), transform .25s var(--ease);
}
.link__arrow svg { width: 18px; height: 18px; }
.link:hover .link__arrow {
  color: var(--accent);
  transform: translateX(4px);
}

/* ---------- Lately ---------- */
.lately {
  margin-bottom: 32px;
  animation: rise .7s .25s var(--ease) both;
}
.section-title {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 500;
  font-size: 15px;
  color: var(--ink-soft);
  text-align: center;
  margin: 0 0 14px;
  position: relative;
}
.section-title::before,
.section-title::after {
  content: "";
  position: absolute; top: 50%;
  width: 36px; height: 1px;
  background: var(--border);
}
.section-title::before { right: calc(50% + 38px); }
.section-title::after  { left:  calc(50% + 38px); }

.lately__list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.lately__list li a {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  transition: background .2s var(--ease);
}
.lately__list li a:hover { background: var(--accent-soft); }
.lately__list .date {
  font-size: 12px;
  color: var(--accent);
  font-weight: 600;
  letter-spacing: .04em;
  min-width: 52px;
  flex-shrink: 0;
}
.lately__list .t {
  font-family: var(--serif);
  font-size: 15.5px;
  color: var(--ink);
  line-height: 1.35;
}

/* ---------- Products gallery ---------- */
.products {
  margin-bottom: 32px;
  animation: rise .7s .3s var(--ease) both;
}
/* Masonry-ish grid: fixed columns, row height in 4px units.
   JS sets each card's `grid-row-end: span N` from the image aspect ratio,
   so vertical / square / horizontal images all keep their natural shape. */
.products__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-auto-rows: 4px;
  gap: 12px;
  align-items: start;
}
.product-card {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .2s var(--ease);
}
.product-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  border-color: var(--ink);
}
.product-card__media {
  position: relative;
  width: 100%;
  background: var(--bg-soft);
  overflow: hidden;
  /* Default aspect ratio while image is loading or for placeholders */
  aspect-ratio: var(--ratio, 1 / 1);
}
.product-card__media img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform .5s var(--ease);
}
/* Once image is loaded, the <img> drives height; drop the placeholder ratio. */
.product-card__media.is-loaded { aspect-ratio: auto; }
.product-card:hover .product-card__media img { transform: scale(1.04); }

.product-card__media--missing {
  background:
    repeating-linear-gradient(135deg,
      var(--bg-soft) 0 10px,
      var(--border) 10px 11px);
}
.product-card__media--missing::before {
  content: attr(data-initials);
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 600;
  font-size: 32px;
  letter-spacing: -.02em;
  color: var(--ink);
  opacity: .55;
}

.product-card__badge {
  position: absolute;
  top: 8px; left: 8px;
  background: var(--ink);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .12em;
  padding: 4px 7px;
  border-radius: 4px;
  text-transform: uppercase;
}
.product-card__body {
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.product-card__name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.product-card__price {
  font-size: 12.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

@media (min-width: 480px) {
  .products__grid { grid-template-columns: repeat(3, 1fr); }
  .product-card__name { font-size: 14px; }
}

/* ---------- Socials ---------- */
.socials {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 28px;
  animation: rise .7s .35s var(--ease) both;
}
.socials a {
  width: 42px; height: 42px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--ink);
  transition: background .2s var(--ease), color .2s var(--ease), transform .2s var(--ease), border-color .2s var(--ease);
}
.socials a svg { width: 18px; height: 18px; }
.socials a:hover {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
  transform: translateY(-2px);
}

/* ---------- Footer ---------- */
.footer {
  text-align: center;
  font-size: 12.5px;
  color: var(--muted);
  font-family: var(--serif);
  font-style: italic;
  margin-top: 8px;
  animation: rise .7s .45s var(--ease) both;
}

/* ---------- Product detail page ---------- */
.page--product { padding-top: 24px; }
.back-link {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--ink-soft);
  padding: 6px 0;
  margin-bottom: 14px;
  transition: color .2s var(--ease);
}
.back-link:hover { color: var(--ink); }
.back-link__arrow { font-size: 16px; }

.product {
  animation: rise .6s var(--ease) both;
}
.product__media {
  position: relative;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: var(--ratio, 1 / 1);
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}
.product__media img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.product__media-placeholder {
  width: 100%; height: 100%;
  background:
    repeating-linear-gradient(135deg,
      var(--bg-soft) 0 10px,
      var(--border) 10px 11px);
  display: flex; align-items: center; justify-content: center;
}
.product__media-placeholder::before {
  content: attr(data-initials);
  font-family: var(--serif);
  font-style: italic;
  font-weight: 600;
  font-size: 64px;
  color: var(--ink);
  opacity: .55;
}
.product__badge {
  position: absolute; top: 12px; left: 12px;
  background: var(--ink);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .15em;
  padding: 5px 9px;
  border-radius: 4px;
  text-transform: uppercase;
}
.product__thumbs {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin-bottom: 24px;
}
.product__thumb {
  width: 64px; height: 64px;
  padding: 0; border-radius: 8px;
  background: var(--card);
  border: 1px solid var(--border);
  overflow: hidden;
  cursor: pointer;
  transition: border-color .2s var(--ease), transform .2s var(--ease);
}
.product__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.product__thumb:hover { transform: translateY(-1px); border-color: var(--ink-soft); }
.product__thumb.is-active { border-color: var(--ink); }

.product__head {
  margin-bottom: 14px;
}
.product__title {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(26px, 5vw, 36px);
  letter-spacing: -.02em;
  line-height: 1.15;
  margin: 4px 0 6px;
  color: var(--ink);
}
.product__price {
  font-size: 16px;
  color: var(--ink-soft);
  margin: 0;
  font-variant-numeric: tabular-nums;
}
.product__desc {
  font-family: var(--serif);
  font-size: 16.5px;
  line-height: 1.55;
  color: var(--ink-soft);
  margin: 14px 0 26px;
}
.product__buy { margin-bottom: 32px; }
.product__buy .section-title { text-align: left; margin-bottom: 12px; }
.product__buy .section-title::before,
.product__buy .section-title::after { display: none; }

.product__back { margin: 12px 0 24px; }

/* ---------- Flash + form components (used by install + admin) ---------- */
.flash {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  margin-bottom: 16px;
}
.flash--ok  { background: #e6f4ea; color: #1d4d28; border: 1px solid #b6dcc1; }
.flash--err { background: #fbeaea; color: #6a1f1f; border: 1px solid #e5b7b7; }

.card-form {
  display: flex; flex-direction: column; gap: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span {
  font-size: 12px; letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
.field input,
.field select,
.field textarea {
  font: inherit;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  transition: border-color .15s var(--ease), background .15s var(--ease);
}
.field textarea { min-height: 120px; resize: vertical; }
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--ink);
  background: #fff;
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: inherit; font-weight: 600;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
  transition: background .15s var(--ease), color .15s var(--ease), border-color .15s var(--ease), transform .1s var(--ease);
  text-decoration: none;
}
.btn:hover { border-color: var(--ink); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn-primary:hover { background: #000; }
.btn-danger  { background: #fff; color: #6a1f1f; border-color: #e5b7b7; }
.btn-danger:hover { background: #fbeaea; }
.btn-small { padding: 6px 10px; font-size: 12.5px; }

/* ---------- Animations ---------- */
@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 480px) {
  .page { padding: 40px 16px 36px; }
  .avatar { width: 76px; height: 76px; font-size: 30px; }
  .link { padding: 16px; }
  .featured { padding: 20px; }
  .featured__title { font-size: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
  }
}
