/* PELI — Fine Jewelry · Cairo */

@font-face {
  font-family: 'Foundry Old Style';
  src: url('../assets/fonts/foundry-old-style-normal.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Foundry Old Style';
  src: url('../assets/fonts/foundry-old-style-italic.woff2') format('woff2');
  font-weight: 400; font-style: italic; font-display: swap;
}
@font-face {
  font-family: 'Foundry Old Style';
  src: url('../assets/fonts/foundry-old-style-medium.woff2') format('woff2');
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Sebastian Bobby';
  src: url('../assets/fonts/sebastian-bobby.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}

:root {
  --azure: #5A80CC;
  --ivory: #FEFAE3;
  --warm: #FAF8F0;
  --sky: #B0CDE9;
  --peach: #FCA07A;
  --text: #2A2A2A;
  --text-soft: #6A6A66;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --serif: 'Foundry Old Style', Georgia, 'Times New Roman', serif;
  --script: 'Sebastian Bobby', 'Snell Roundhand', cursive;
}

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

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-text-size-adjust: 100%;
  background: var(--ivory);
}
html.locked { overflow: hidden; }

body {
  font-family: var(--serif);
  background: var(--ivory);
  color: var(--text);
}

img { display: block; max-width: 100%; }
svg { fill: currentColor; display: block; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.mark { aspect-ratio: 211.66 / 256.35; height: 100%; width: auto; }
.type { aspect-ratio: 376.46 / 148.38; height: 100%; width: auto; }

:focus-visible { outline: 1px solid var(--azure); outline-offset: 6px; }

/* ===== Gate ===== */
.gate {
  position: fixed; inset: 0; z-index: 1000;
  display: none;
  flex-direction: column; justify-content: center; align-items: center;
  width: 100%; border: 0;
  background: var(--ivory); color: var(--azure);
  font: inherit; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: opacity 1.2s var(--ease);
}
.js .gate { display: flex; }
.gate.out { opacity: 0; pointer-events: none; }
.gate__mark { height: 56px; opacity: 0.32; margin-bottom: 44px; transition: opacity 0.6s var(--ease); }
.gate__word {
  font-size: 13px; letter-spacing: 0.32em; text-indent: 0.32em;
  animation: breathe 3.2s ease-in-out infinite;
}
@keyframes breathe {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.85; }
}

/* ===== Nav ===== */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; justify-content: center;
  padding: 20px 36px;
  color: var(--azure);
  background: rgba(254, 250, 227, 0.88);
  -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px);
  opacity: 0; transform: translateY(-100%);
  pointer-events: none;
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}
.nav.show { opacity: 1; transform: none; pointer-events: auto; }
.nav a { display: flex; align-items: center; gap: 12px; color: inherit; }
.nav__mark { height: 24px; }
.nav__type { height: 10px; }

/* ===== Hero ===== */
.hero {
  position: relative;
  height: 100vh; height: 100svh; min-height: 560px;
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  background: var(--ivory); color: var(--azure);
}
.hero__mark { height: 86px; }
.hero__type { height: 24px; margin-top: 28px; }
.hero__sub {
  margin-top: 30px;
  font-size: 14px; letter-spacing: 0.22em; text-indent: 0.22em;
  opacity: 0.7;
}
.hero__line {
  position: absolute; bottom: 32px; left: 50%;
  width: 1px; height: 30px; margin-left: -0.5px;
  background: var(--azure); opacity: 0.3;
  transform-origin: top;
  animation: pulse 2.6s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { transform: scaleY(0.35); }
  50% { transform: scaleY(1); }
}

.js .hero__mark { opacity: 0; transform: scale(0.9); transition: opacity 2s var(--ease), transform 2.2s var(--ease); }
.js .hero__type { opacity: 0; transition: opacity 1.4s var(--ease); }
.js .hero__sub  { opacity: 0; transition: opacity 1.2s var(--ease); }
.js .hero__line { opacity: 0; transition: opacity 1.2s var(--ease); }
.js .hero__mark.on { opacity: 1; transform: none; }
.js .hero__type.on { opacity: 1; }
.js .hero__sub.on  { opacity: 0.7; }
.js .hero__line.on { opacity: 0.3; }

/* ===== Ihdina — the centerpiece ===== */
.ihdina { background: var(--warm); }
.ihdina__stage {
  height: 100vh; height: 100svh; min-height: 520px;
  display: flex; justify-content: center; align-items: center;
  padding: 7vh 24px;
  background: var(--warm);   /* the photo blends against this */
}
.ihdina img {
  width: auto; height: auto; max-width: 100%; max-height: 100%;
  /* lets the studio backdrop melt into the warm white page:
     lift the pale grey backdrop to white, then multiply it away */
  filter: brightness(1.085);
  mix-blend-mode: multiply;
  -webkit-mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 62%, transparent 100%);
          mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 62%, transparent 100%);
  will-change: opacity, transform;
}
/* scroll-linked emergence (values set from JS) */
.js .ihdina { height: 170vh; }
.js .ihdina__stage { position: sticky; top: 0; }
.js .ihdina img {
  opacity: var(--p, 0);
  transform: translate3d(0, calc((1 - var(--p, 0)) * 9vh), 0) scale(calc(0.95 + var(--p, 0) * 0.05));
}

/* ===== Guide us. ===== */
.guide {
  height: 80vh; min-height: 340px;
  display: flex; justify-content: center; align-items: center;
  background: var(--ivory);
}
.guide p {
  font-size: clamp(18px, 2.6vw, 26px);
  letter-spacing: 0.36em; text-indent: 0.36em;
  color: var(--azure);
}

/* ===== Lifestyle frames ===== */
.frame { overflow: hidden; background: var(--warm); }
.frame img {
  width: 100%; height: 88vh;
  object-fit: cover; object-position: var(--focus, 50% 50%);
}
.frame--portrait { padding: 9vh 24px; }
.frame--portrait img { width: auto; height: 84vh; margin: 0 auto; object-fit: contain; }

.pair {
  display: grid; grid-template-columns: 1fr 1fr; gap: 3px;
  background: var(--warm);
}
.pair .frame img { height: auto; aspect-ratio: 4 / 5; }
.pair + .frame { border-top: 3px solid var(--warm); }

/* ===== Text ===== */
.text {
  max-width: 600px; margin: 0 auto;
  padding: 160px 28px;
  text-align: center;
}
.text h2 {
  font-family: var(--script); font-weight: 400;
  font-size: clamp(34px, 5.4vw, 50px);
  line-height: 1.15;
  color: var(--azure);
  margin-bottom: 34px;
}
.text p {
  max-width: 440px; margin: 0 auto;
  font-size: clamp(16px, 1.7vw, 18px);
  line-height: 1.95;
  color: var(--text-soft);
}

/* ===== Brand statement ===== */
.statement {
  background: var(--ivory);
  padding: 190px 28px;
  text-align: center;
}
.statement p {
  max-width: 520px; margin: 0 auto;
  font-size: clamp(18px, 2.4vw, 23px);
  font-style: italic;
  line-height: 2.1;
  color: var(--azure);
}

/* ===== Footer ===== */
.footer {
  background: var(--azure); color: var(--ivory);
  padding: 80px 24px 64px;
  text-align: center;
}
.footer__logo { display: flex; flex-direction: column; align-items: center; gap: 16px; margin-bottom: 46px; }
.footer__mark { height: 44px; }
.footer__type { height: 12px; }
.footer__links { display: flex; justify-content: center; gap: 40px; margin-bottom: 46px; }
.footer__links a {
  font-size: 12px; letter-spacing: 0.18em; text-indent: 0.18em;
  color: inherit; text-decoration: none;
  padding: 10px 4px;
  opacity: 0.85;
  transition: opacity 0.4s var(--ease);
}
.footer__links a:focus-visible { outline-color: var(--ivory); }
.footer__note { font-size: 11px; letter-spacing: 0.13em; line-height: 2.4; opacity: 0.7; }

@media (hover: hover) {
  .gate:hover .gate__mark { opacity: 0.55; }
  .footer__links a:hover { opacity: 1; }
}

/* ===== Scroll reveals ===== */
.js .reveal > * {
  opacity: 0; transform: translateY(20px);
  transition: opacity 1.2s var(--ease), transform 1.2s var(--ease);
}
.js .reveal > *:nth-child(2) { transition-delay: 0.2s; }
.js .reveal.vis > * { opacity: 1; transform: none; }

.js .frame img {
  opacity: 0; transform: scale(1.04);
  transition: opacity 1.4s var(--ease), transform 2.6s var(--ease);
}
.js .frame.vis img { opacity: 1; transform: none; }
.js .pair .frame:nth-child(2) img { transition-delay: 0.3s; }

/* ===== Mobile ===== */
@media (max-width: 768px) {
  .hero__mark { height: 66px; }
  .hero__type { height: 19px; }
  .nav { padding: 15px 20px; }
  .nav__mark { height: 20px; }
  .nav__type { height: 9px; }
  .ihdina__stage { padding: 9vh 16px; }
  .frame img, .frame--portrait img { width: 100%; height: auto; }
  .frame--portrait { padding: 0; }
  .pair { grid-template-columns: 1fr; gap: 2px; }
  .pair .frame img { aspect-ratio: auto; }
  .text { padding: 110px 28px; }
  .statement { padding: 130px 28px; }
  .guide { height: 70vh; }
}

/* ===== Reduced motion ===== */
@media (prefers-reduced-motion: reduce) {
  .gate__word, .hero__line { animation: none; }
  .gate__word { opacity: 0.8; }
  .js .ihdina { height: auto; }
  .js .ihdina__stage { position: static; }
  .js .ihdina img { opacity: 1; transform: none; }
  .js .reveal > *, .js .frame img, .js .hero__mark { transform: none; transition-duration: 0.6s; transition-delay: 0s; }
  .nav { transition-duration: 0.01s; }
}

/* ===== The Pieces: collection and piece pages ===== */
.bar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 24px 36px;
  color: var(--azure);
}
.bar a { color: inherit; text-decoration: none; }
.bar__home { display: flex; align-items: center; gap: 12px; }
.bar__mark { height: 26px; }
.bar__type { height: 10px; }
.bar__link { font-size: 12px; letter-spacing: 0.18em; padding: 10px 0; opacity: 0.85; }

.pieces-head { text-align: center; padding: 90px 28px 90px; }
.pieces-head h1 {
  font-family: var(--script); font-weight: 400;
  font-size: clamp(40px, 6vw, 60px); line-height: 1.15;
  color: var(--azure);
}
.pieces-head p { margin-top: 22px; font-size: 16px; font-style: italic; color: var(--text-soft); }

.grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 64px 28px;
  max-width: 1240px; margin: 0 auto; padding: 0 36px 150px;
}
.card { display: block; text-align: center; text-decoration: none; color: inherit; }
.card__img { aspect-ratio: 4 / 5; overflow: hidden; background: var(--warm); }
.card__img img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.8s var(--ease); }
img.studio, .studio img { mix-blend-mode: multiply; }
.card__name {
  margin-top: 22px;
  font-size: 13px; font-weight: 400; line-height: 1.6;
  letter-spacing: 0.2em; text-indent: 0.2em; text-transform: uppercase;
  color: var(--azure);
}
.card__meta { margin-top: 6px; font-size: 15px; font-style: italic; color: var(--text-soft); }

.empty {
  width: 100%; height: 100%; min-height: 320px;
  display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 22px;
  background: var(--warm); color: var(--azure);
}
.empty .mark { height: 46px; opacity: 0.28; }
.empty span { font-size: 11px; letter-spacing: 0.2em; text-indent: 0.2em; text-transform: uppercase; opacity: 0.55; }

.piece {
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 72px;
  max-width: 1240px; margin: 0 auto; padding: 36px 36px 130px;
  align-items: start;
}
.piece__media { display: grid; gap: 3px; }
.piece__media figure { background: var(--warm); }
.piece__media img { width: 100%; height: auto; }
.piece__media .empty { aspect-ratio: 4 / 5; }
.piece__info { position: sticky; top: 48px; padding-top: 56px; max-width: 440px; }
.piece__kind { font-size: 12px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--azure); opacity: 0.75; }
.piece__info h1 {
  margin-top: 18px;
  font-family: var(--script); font-weight: 400;
  font-size: clamp(34px, 4.2vw, 48px); line-height: 1.2;
  color: var(--azure);
}
.piece__desc { margin-top: 30px; font-size: 17px; line-height: 1.95; color: var(--text-soft); }
.piece__specs { list-style: none; margin-top: 34px; border-top: 1px solid rgba(90, 128, 204, 0.22); }
.piece__specs li {
  padding: 13px 0; border-bottom: 1px solid rgba(90, 128, 204, 0.22);
  font-size: 15px; letter-spacing: 0.03em; color: var(--text);
}
.piece__price { margin-top: 34px; font-size: 17px; letter-spacing: 0.08em; color: var(--text); }
.piece__enquire {
  display: inline-block; margin-top: 30px; padding: 15px 44px;
  border: 1px solid var(--azure);
  font-size: 12px; letter-spacing: 0.24em; text-indent: 0.24em; text-transform: uppercase;
  color: var(--azure); text-decoration: none;
  transition: background 0.5s var(--ease), color 0.5s var(--ease);
}

.piece-nav {
  display: grid; grid-template-columns: 1fr auto 1fr; gap: 24px;
  max-width: 1240px; margin: 0 auto; padding: 44px 36px 110px;
  border-top: 1px solid rgba(90, 128, 204, 0.22);
}
.piece-nav a { font-size: 16px; font-style: italic; color: var(--text-soft); text-decoration: none; line-height: 1.5; }
.piece-nav a:nth-child(2) { text-align: center; }
.piece-nav a:last-child { text-align: right; }
.piece-nav span {
  display: block; margin-bottom: 6px;
  font-size: 11px; font-style: normal; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--azure);
}

.more { background: var(--ivory); padding: 120px 28px 130px; text-align: center; }
.more a {
  font-size: 13px; letter-spacing: 0.3em; text-indent: 0.3em; text-transform: uppercase;
  color: var(--azure); text-decoration: none;
  padding: 12px 4px; border-bottom: 1px solid rgba(90, 128, 204, 0.4);
}

@media (hover: hover) {
  .card:hover .card__img img { transform: scale(1.035); }
  .bar__link:hover { opacity: 1; }
  .piece__enquire:hover { background: var(--azure); color: var(--ivory); }
  .piece-nav a:hover { color: var(--azure); }
}

@media (max-width: 860px) {
  .bar { padding: 18px 20px; }
  .pieces-head { padding: 56px 24px 60px; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 40px 14px; padding: 0 16px 100px; }
  .card__name { font-size: 11px; letter-spacing: 0.16em; text-indent: 0.16em; margin-top: 16px; }
  .card__meta { font-size: 13px; }
  .empty { min-height: 0; }
  .piece { grid-template-columns: 1fr; gap: 0; padding: 0 0 80px; }
  .piece__info { position: static; max-width: none; padding: 44px 24px 0; }
  .piece-nav { grid-template-columns: 1fr 1fr; padding: 36px 24px 80px; }
  .piece-nav a:nth-child(2) { display: none; }
  .more { padding: 90px 24px 100px; }
}
