/* Armaan’s Fidgets — cream catalog palette, compact shop-first layout. */

*,
*::before,
*::after { box-sizing: border-box; }

html,
body { margin: 0; }

html {
  scroll-padding-top: var(--nav-scrolled);
  hanging-punctuation: first allow-end last;
  background: var(--p-bg);
}

:root {
  --p-bg: #f5f0e6;
  --p-surface: #fffcf7;
  --p-ink: #242120;
  --p-muted: #6b6661;
  --p-accent: #9e2e1f;
  --p-accent-ink: #fff7f0;
  --p-action: #9e2e1f;
  --p-action-ink: #fff7f0;
  --p-inv-bg: #242120;
  --p-inv-surface: #302d2c;
  --p-inv-ink: #f5f0e6;
  --p-inv-muted: #9e9a94;
  --p-line: rgba(36, 33, 32, 0.12);
  --p-line-strong: rgba(36, 33, 32, 0.2);

  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-text: "Figtree", system-ui, sans-serif;

  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  --s-8: 64px;

  --nav: 64px;
  --nav-scrolled: 52px;
  --gut: 80px;
  --wrap: 1280px;
  --r: 20px;
  --r-sm: 10px;

  --t-h1: clamp(32px, 2.4vw + 22px, 44px);
  --t-h2: clamp(28px, 1.2vw + 22px, 40px);
  --t-h3: 18px;
  --t-lead: 18px;
  --t-body: 16px;
  --t-small: 14px;
  --t-label: 13px;

  --m-in: 150ms;
  --m-out: 120ms;
  --m-press: 90ms;
  --m-image: 500ms;
  --m-image-out: 350ms;
  --m-reveal: 420ms;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --m-ease-enter: cubic-bezier(.22, 1, .36, 1);

  --card: var(--p-surface);
}

@media (max-width: 1023px) {
  :root { --gut: 40px; }
}

@media (max-width: 639px) {
  :root {
    --nav: 56px;
    --nav-scrolled: 48px;
    --gut: 24px;
    --t-h3: 17px;
  }
}

body {
  background: var(--p-bg);
  color: var(--p-ink);
  font-family: var(--font-text);
  font-size: var(--t-body);
  font-weight: 400;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-optical-sizing: auto;
  font-variation-settings: "SOFT" 30, "WONK" 0;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0;
  color: var(--p-ink);
}

h1 { font-size: var(--t-h1); letter-spacing: -0.03em; }
h2 { font-size: var(--t-h2); }
h3 {
  font-family: var(--font-text);
  font-size: var(--t-h3);
  font-weight: 500;
  letter-spacing: -0.02em;
  font-variation-settings: normal;
}

p { margin: 0; }

a {
  color: inherit;
  text-decoration-color: rgba(36, 33, 32, 0.28);
  text-underline-offset: 3px;
}

:focus-visible {
  outline: 2px solid var(--p-action);
  outline-offset: 2px;
}

.wrap {
  width: min(100% - 2 * var(--gut), var(--wrap));
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  left: var(--gut);
  top: 0;
  transform: translateY(-120%);
  background: var(--p-ink);
  color: var(--p-inv-ink);
  padding: 8px 16px;
  z-index: 60;
  border-radius: 0 0 var(--r-sm) var(--r-sm);
}
.skip-link:focus { transform: none; }

.scroll-sentinel {
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

/* Header */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--nav);
  z-index: 40;
  background: color-mix(in srgb, var(--p-bg) 88%, transparent);
  backdrop-filter: blur(12px) saturate(1.2);
  -webkit-backdrop-filter: blur(12px) saturate(1.2);
  border-bottom: 1px solid transparent;
  box-shadow: 0 0 0 rgba(36, 33, 32, 0);
  transition: height 300ms var(--ease), box-shadow 300ms var(--ease), border-color 300ms var(--ease);
}

.site-header.is-scrolled {
  height: var(--nav-scrolled);
  border-bottom-color: var(--p-line);
  box-shadow: 0 8px 20px rgba(36, 33, 32, 0.07);
}

.header-bar {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-5);
  position: relative;
}

.wordmark {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 400;
  letter-spacing: -0.02em;
  font-variation-settings: "SOFT" 30, "WONK" 0;
  text-decoration: none;
  white-space: nowrap;
  transition: font-size 300ms var(--ease);
}
.site-header.is-scrolled .wordmark { font-size: 16px; }

.nav {
  display: flex;
  align-items: center;
  gap: var(--s-2);
}

.nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  text-decoration: none;
  font-size: var(--t-body);
  position: relative;
  white-space: nowrap;
}
.nav-short { display: none; }
.nav a::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 8px;
  height: 1px;
  background: var(--p-ink);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--m-in) var(--ease);
}
.nav a:hover::after,
.nav a:focus-visible::after { transform: scaleX(1); }

/* Intro — compact, then straight into the grid */
.intro {
  padding-top: calc(var(--nav) + 28px);
  padding-bottom: 20px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: var(--s-5);
  flex-wrap: wrap;
}

.intro-lead {
  margin-top: 8px;
  font-size: var(--t-lead);
  color: var(--p-ink);
}

.intro-lead .from {
  font-family: var(--font-display);
  font-variation-settings: "SOFT" 30, "WONK" 0;
  color: var(--p-accent);
  letter-spacing: -0.02em;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  margin-left: auto;
}

.sort-label {
  font-size: var(--t-label);
  font-weight: 500;
  color: var(--p-muted);
}

.sort {
  appearance: none;
  -webkit-appearance: none;
  min-height: 44px;
  padding: 0 40px 0 16px;
  border: 1px solid var(--p-line-strong);
  border-radius: 999px;
  background: var(--p-surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%23242120' stroke-width='1.4' d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E") no-repeat right 14px center;
  font-family: var(--font-text);
  font-size: var(--t-body);
  color: var(--p-ink);
  cursor: pointer;
}

/* Shop grid */
.shop { padding-bottom: var(--s-8); }

.product-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s-5);
}

.card {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 1px solid var(--p-line);
  border-radius: var(--r);
  background: var(--card);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  appearance: none;
  -webkit-appearance: none;
  transition: transform 180ms var(--ease), border-color 180ms var(--ease), box-shadow 180ms var(--ease);
}

.frame {
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #ebe6dc;
  position: relative;
}

.frame picture { display: block; width: 100%; height: 100%; }
.frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform var(--m-image) var(--ease);
}

.price-badge {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 1;
  background: var(--p-accent);
  color: var(--p-accent-ink);
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 400;
  font-variation-settings: "SOFT" 30, "WONK" 0;
  letter-spacing: -0.02em;
  line-height: 1;
  padding: 8px 11px 7px;
  border-radius: 8px;
  pointer-events: none;
}

.card-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 18px 18px;
  flex: 1;
}

.card-title {
  font-family: var(--font-text);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.3;
  transition: text-decoration-color var(--m-in) var(--ease);
}

.card-desc {
  font-size: var(--t-body);
  line-height: 1.45;
  color: var(--p-ink);
}

@media (hover: hover) and (pointer: fine) {
  .card:hover {
    transform: translateY(-2px);
    border-color: var(--p-line-strong);
    box-shadow: 0 16px 24px rgba(36, 33, 32, 0.08);
  }
  .card:hover .frame img { transform: scale(1.03); }
  .card:hover .card-title {
    text-decoration: underline;
    text-decoration-color: var(--p-ink);
    text-underline-offset: 3px;
  }
}

.card:active { transform: translateY(0); }

/* How to order */
.order {
  background: var(--p-surface);
  border-top: 1px solid var(--p-line);
  padding: 64px 0;
}

.order-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-8);
  align-items: center;
}

.section-lead {
  font-size: var(--t-lead);
  color: var(--p-ink);
  margin: 12px 0 32px;
}

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.steps li {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: var(--s-4);
  align-items: start;
}

.step-n {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--p-line-strong);
  border-radius: 50%;
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--p-accent);
  font-variation-settings: "SOFT" 30, "WONK" 0;
}

.steps h3 { margin-bottom: 2px; }
.steps p { line-height: 1.45; }

.order-media {
  border-radius: var(--r);
  overflow: hidden;
  border: 1px solid var(--p-line);
  aspect-ratio: 4 / 3;
}
.order-media picture { display: block; width: 100%; height: 100%; }
.order-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Footer */
.site-footer {
  background: var(--p-inv-bg);
  color: var(--p-inv-ink);
  padding: var(--s-7) 0;
}

.footer-bar {
  display: flex;
  justify-content: space-between;
  gap: var(--s-5);
  align-items: baseline;
  flex-wrap: wrap;
}

.footer-meta { color: var(--p-inv-muted); }

/* Viewer */
#viewer {
  width: min(920px, calc(100% - 32px));
  max-width: calc(100% - 32px);
  max-height: calc(100dvh - 32px);
  border: 0;
  padding: 0;
  border-radius: var(--r);
  background: var(--p-surface);
  color: var(--p-ink);
  box-shadow: 0 24px 48px rgba(36, 33, 32, 0.28);
  overflow: auto;
}
#viewer::backdrop { background: rgba(36, 33, 32, 0.56); }

.viewer-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.viewer-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: var(--p-surface);
  color: var(--p-ink);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(36, 33, 32, 0.18);
}
.viewer-close:hover { background: var(--p-bg); }

.viewer-photo {
  background: #ebe6dc;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 1 auto;
}
.viewer-photo img {
  width: 100%;
  height: auto;
  max-height: calc(100dvh - 230px);
  object-fit: contain;
  background: #ebe6dc;
}

.viewer-copy {
  flex: 0 0 auto;
  padding: var(--s-5) var(--s-6) var(--s-6);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--s-2) var(--s-5);
  align-items: baseline;
  background: var(--p-surface);
}
.viewer-copy h2 { grid-column: 1; font-size: clamp(24px, 2vw + 16px, 32px); }
.viewer-copy .price {
  grid-column: 2;
  font-family: var(--font-display);
  font-variation-settings: "SOFT" 30, "WONK" 0;
  color: var(--p-accent);
  font-size: 28px;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.viewer-copy #viewer-desc {
  grid-column: 1 / -1;
  font-size: var(--t-body);
  line-height: 1.55;
  max-width: 52ch;
}

/* Reveals — only when JS enables motion. Without JS, everything is visible. */
.js-motion .reveal {
  opacity: 0;
  transform: translateY(12px);
}
.js-motion .card.reveal .frame img {
  transform: scale(1.06);
}
.js-motion .reveal.is-in {
  opacity: 1;
  transform: none;
  transition: opacity var(--m-reveal) var(--ease), transform var(--m-reveal) var(--ease);
  transition-delay: var(--stagger, 0ms);
}
.js-motion .card.reveal.is-in .frame img {
  transform: scale(1);
  transition: transform 500ms var(--ease);
  transition-delay: var(--stagger, 0ms);
}
@media (hover: hover) and (pointer: fine) {
  .js-motion .card.reveal.is-in:hover .frame img { transform: scale(1.03); }
}

/* Breakpoints */
@media (max-width: 1023px) {
  .product-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 767px) {
  .order { padding: 48px 0; }
  .order-grid {
    grid-template-columns: 1fr;
    gap: var(--s-7);
  }
  .intro {
    padding-top: calc(var(--nav) + 20px);
    padding-bottom: 16px;
    align-items: start;
  }
  .toolbar { margin-left: 0; width: 100%; }
  .sort { flex: 1; }
}

@media (max-width: 639px) {
  .product-grid { grid-template-columns: 1fr; gap: 16px; }
  .wordmark { font-size: 16px; }
  .site-header.is-scrolled .wordmark { font-size: 15px; }
  .nav a { padding: 0 8px; font-size: 15px; }
  .nav a::after { left: 8px; right: 8px; }
  .card-body { padding: 14px 16px 16px; }
  .viewer-copy { padding: var(--s-4); }
  .footer-bar { flex-direction: column; gap: var(--s-3); }
}

@media (max-width: 359px) {
  .nav-long { display: none; }
  .nav-short { display: inline; }
  .wordmark { font-size: 15px; }
  .nav a { padding: 0 6px; font-size: 14px; }
  .nav a:last-child { padding-right: 0; }
  .nav a::after { left: 6px; right: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
  .js-motion .reveal,
  .js-motion .card.reveal .frame img {
    opacity: 1 !important;
    transform: none !important;
  }
}

@media print {
  .site-header, .toolbar, .viewer-close, #viewer { display: none !important; }
  .intro { padding-top: 0; }
  body { background: #fff; }
  .js-motion .reveal { opacity: 1; transform: none; }
}
