/* Sid Thaly: site styles
   Palette "Gilded Ink": night navy for the gallery, parchment for the paper sections,
   antique gold as the accent on dark and oxblood as the accent on paper. */

/* Fonts are self-hosted (faster, and no third-party requests for visitors) */
@font-face { font-family: "Cormorant Garamond"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/cormorant-garamond-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Cormorant Garamond"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/cormorant-garamond-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Cormorant Garamond"; font-style: italic; font-weight: 500; font-display: swap; src: url("../fonts/cormorant-garamond-latin-500-italic.woff2") format("woff2"); }
@font-face { font-family: "Figtree"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/figtree-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Figtree"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/figtree-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Figtree"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/figtree-latin-600-normal.woff2") format("woff2"); }

:root {
  --night: #121829;        /* page background, gallery */
  --navy: #1b2338;         /* raised dark surfaces */
  --gold: #c9a24a;         /* accent on dark */
  --gold-light: #e2c682;   /* hover on dark */
  --parchment: #efe6d2;    /* text on dark, paper background */
  --paper-field: #f7f1e3;  /* form fields on paper */
  --paper-line: #c9bb9a;   /* borders on paper */
  --ink: #221c14;          /* text on paper */
  --sepia: #6b5a40;        /* secondary text on paper */
  --mist: #a3abbd;         /* secondary text on dark */
  --mist-light: #cfd3dd;   /* body text on dark */
  --oxblood: #7a2331;      /* accent on paper */
  --oxblood-dark: #5e1925;

  --serif: "Cormorant Garamond", "Cormorant", Garamond, "Times New Roman", serif;
  --sans: "Figtree", "Helvetica Neue", Arial, system-ui, sans-serif;

  --gutter: clamp(16px, 4vw, 40px);
  --section: clamp(4rem, 9vw, 7.5rem);

  color-scheme: dark;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--night);
  color: var(--parchment);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a { color: inherit; }

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.05;
  margin: 0;
  text-wrap: balance;
}

h2 { font-size: clamp(2.6rem, 5.2vw, 4.25rem); letter-spacing: -0.01em; }
h3 { font-size: clamp(1.5rem, 2.2vw, 1.85rem); }

p { margin: 0; }

.wrap {
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.paper :focus-visible { outline-color: var(--oxblood); }

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 50;
  background: var(--gold);
  color: var(--night);
  padding: 0.5rem 1rem;
}
.skip:focus { top: 1rem; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.5rem;
  border: 1px solid var(--gold);
  border-radius: 2px;
  background: var(--gold);
  color: var(--night);
  font: 600 0.95rem/1 var(--sans);
  letter-spacing: 0.01em;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}
.btn:hover { background: var(--gold-light); border-color: var(--gold-light); }

.btn-quiet { background: transparent; color: var(--parchment); border-color: rgba(239, 230, 210, 0.35); }
.btn-quiet:hover { background: transparent; border-color: var(--parchment); }

.btn-small { padding: 0.6rem 1rem; font-size: 0.875rem; }

.paper .btn { background: var(--oxblood); border-color: var(--oxblood); color: var(--parchment); }
.paper .btn:hover { background: var(--oxblood-dark); border-color: var(--oxblood-dark); }

/* Header */
.site-header {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 20;
  background: rgba(18, 24, 41, 0.86);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(201, 162, 74, 0.16);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 68px;
}
.wordmark {
  font-family: var(--serif);
  font-size: 1.6rem;
  font-weight: 600;
  text-decoration: none;
  letter-spacing: 0.01em;
}
.nav {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2.5vw, 2.25rem);
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav a:not(.btn) {
  font-size: 0.95rem;
  color: var(--mist-light);
  text-decoration: none;
}
.nav a:not(.btn):hover { color: var(--parchment); }

/* Hero */
.hero {
  padding-block: clamp(3rem, 7vw, 6.5rem) clamp(3.5rem, 7vw, 6rem);
  background:
    radial-gradient(ellipse 45% 60% at 76% 48%, rgba(201, 162, 74, 0.13), transparent 70%),
    var(--night);
  overflow: hidden;
}
.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  align-items: center;
  gap: clamp(2.5rem, 6vw, 5rem);
}
.credit {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(1.4rem, 2.3vw, 1.9rem);
  color: var(--gold);
  margin-bottom: 0.25rem;
}
.hero-name {
  font-size: clamp(4.4rem, 11.5vw, 9.75rem);
  line-height: 0.86;
  letter-spacing: -0.015em;
  font-weight: 500;
}
.hero-lede {
  max-width: 33rem;
  margin-top: clamp(1.5rem, 3vw, 2.25rem);
  font-size: 1.125rem;
  color: var(--mist-light);
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 2rem;
}

/* Book mockup: a real 3D book, turned to show the spine */
.hero-book {
  margin: 0;
  justify-self: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.book {
  width: min(340px, 62vw);
  perspective: 1600px;
}
.book::after {
  content: "";
  display: block;
  height: 26px;
  margin: 14px 6% 0 0;
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.6), transparent 70%);
  filter: blur(6px);
}
.book-3d {
  --d: 30px;               /* thickness of the book */
  position: relative;
  aspect-ratio: 2 / 3;
  transform-style: preserve-3d;
  transform: rotateY(24deg) rotateX(3deg);
  animation: book-settle 1.6s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  transition: transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.hero-book:hover .book-3d { transform: rotateY(12deg) rotateX(2deg); }
@keyframes book-settle {
  from { transform: rotateY(48deg) rotateX(3deg); }
  to   { transform: rotateY(24deg) rotateX(3deg); }
}
.book-face { position: absolute; top: 0; }
.book-front {
  inset: 0;
  transform: translateZ(calc(var(--d) / 2));
  border-radius: 1px 3px 3px 1px;
  overflow: hidden;
  background: var(--navy);
}
.book-front img { width: 100%; height: 100%; object-fit: cover; }
.book-front::after {            /* hinge crease and a soft sheen */
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(0,0,0,0.45) 0%, rgba(255,255,255,0.14) 1.4%, rgba(0,0,0,0.22) 3%, transparent 6%),
    linear-gradient(115deg, transparent 55%, rgba(255,255,255,0.06) 70%, transparent 85%);
}
.book-spine {
  left: 0;
  width: var(--d);
  height: 100%;
  transform: rotateY(-90deg) translateZ(calc(var(--d) / 2));
  background-color: var(--navy);
  background-size: auto 100%;
  background-position: left center;
  display: flex;
  align-items: center;
  justify-content: center;
}
.book-spine::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(0,0,0,0.55), rgba(0,0,0,0.3) 50%, rgba(0,0,0,0.6));
}
.book-spine span {
  position: relative;
  writing-mode: vertical-rl;
  font-family: var(--serif);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--gold-light);
}
.book-pages {
  left: calc(100% - var(--d));
  top: 3px;
  width: var(--d);
  height: calc(100% - 6px);
  transform: rotateY(90deg) translateZ(calc(var(--d) / 2));
  background: repeating-linear-gradient(90deg, #efe6d2 0 1px, #d8cdb3 1px 2px);
}
.book-back {
  inset: 0;
  transform: rotateY(180deg) translateZ(calc(var(--d) / 2));
  background: #0d1220;
}
.hero-book figcaption {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--mist);
}

/* Credits */
.credits {
  border-block: 1px solid rgba(201, 162, 74, 0.2);
  background: var(--navy);
}
.credits-list {
  list-style: none;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2.5rem;
  padding-block: 2.25rem;
}
.credits-list li { display: flex; flex-direction: column; gap: 0.35rem; }
.credits-list strong {
  font-family: var(--serif);
  font-size: 1.4rem;
  font-weight: 600;
  line-height: 1.2;
}
.credits-list span { font-size: 0.95rem; color: var(--mist); max-width: 34ch; }

/* Section heads */
.section-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: end;
  gap: 1rem 3rem;
  margin-bottom: clamp(2rem, 4vw, 3rem);
}
.section-head p { max-width: 32rem; color: var(--mist-light); }
.paper .section-head p { color: var(--sepia); }

/* Work */
.work { padding-block: var(--section); }
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.75rem;
  margin-bottom: 2.25rem;
  border-bottom: 1px solid rgba(239, 230, 210, 0.12);
}
.filter {
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  padding: 0.5rem 0 0.7rem;
  color: var(--mist);
  font: 500 0.95rem/1 var(--sans);
  cursor: pointer;
}
.filter:hover { color: var(--parchment); }
.filter[aria-pressed="true"] { color: var(--parchment); border-bottom-color: var(--gold); }

.grid { columns: 3; column-gap: 2rem; }
.piece { break-inside: avoid; margin: 0 0 2.25rem; }
.piece-open {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
}
.piece-open img {
  width: 100%;
  border-radius: 2px;
  transition: filter 0.4s;
}
.piece-open:hover img { filter: brightness(1.1) saturate(1.05); }
.piece figcaption { display: flex; flex-direction: column; gap: 0.1rem; margin-top: 0.75rem; }
.piece-title { font-family: var(--serif); font-size: 1.25rem; font-weight: 600; line-height: 1.25; }
.piece-meta { font-size: 0.85rem; color: var(--mist); }

.more-link { margin-top: 0.5rem; }
.more-link a {
  color: var(--gold);
  text-decoration: underline;
  text-underline-offset: 0.3em;
  text-decoration-thickness: 1px;
}
.more-link a:hover { color: var(--gold-light); }

/* Paper sections */
.paper { background: var(--parchment); color: var(--ink); color-scheme: light; }

/* Commissions */
.commissions { padding-block: var(--section); }
.packages {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1.5rem, 3vw, 2.5rem);
}
.package { border-top: 2px solid var(--ink); padding-top: 1.25rem; }
.package-featured { border-top-color: var(--oxblood); }
.price {
  font-family: var(--serif);
  font-size: 2.75rem;
  font-weight: 600;
  line-height: 1.1;
  margin: 0.5rem 0 1rem;
  font-variant-numeric: lining-nums;
}
.price span { font-family: var(--sans); font-size: 0.85rem; font-weight: 500; color: var(--sepia); }
.package ul { list-style: none; margin: 0; padding: 0; }
.package li { padding: 0.55rem 0; border-bottom: 1px solid rgba(34, 28, 20, 0.12); font-size: 0.975rem; }

.process {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 1.5rem 3rem;
  margin-top: clamp(3.5rem, 7vw, 5.5rem);
}
.steps { margin: 0; padding: 0; list-style: none; counter-reset: step; }
.steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 2.5rem 1fr;
  gap: 0.75rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid rgba(34, 28, 20, 0.12);
}
.steps li::before {
  content: counter(step);
  font-family: var(--serif);
  font-size: 1.6rem;
  line-height: 1;
  color: var(--oxblood);
}
.steps strong { font-weight: 600; }
.terms { grid-column: 2; font-size: 0.95rem; color: var(--sepia); }

/* About */
.about { padding-block: var(--section); }
.about-inner {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: clamp(2rem, 6vw, 5rem);
  align-items: center;
}
.about-photo { width: 100%; border-radius: 2px; }
.about-text { display: flex; flex-direction: column; gap: 1.1rem; max-width: 36rem; }
.about-text h2 { margin-bottom: 0.5rem; }
.about-text p { color: var(--mist-light); }
.about-links { display: flex; flex-wrap: wrap; gap: 0.5rem 1.75rem; list-style: none; margin: 0.5rem 0 0; padding: 0; }
.about-links a { color: var(--gold); text-underline-offset: 0.3em; text-decoration-thickness: 1px; }
.about-links a:hover { color: var(--gold-light); }

/* Brief form */
.brief { padding-block: var(--section); }
.brief-inner {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 2rem clamp(2rem, 6vw, 5rem);
  align-items: start;
}
.brief .section-head { display: flex; flex-direction: column; align-items: flex-start; gap: 1.25rem; margin: 0; }
.brief .section-head a { color: var(--oxblood); text-underline-offset: 0.25em; }
.brief-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.35rem 1.5rem;
}
.field { display: flex; flex-direction: column; gap: 0.45rem; min-width: 0; margin: 0; padding: 0; border: 0; }
.field-wide { grid-column: 1 / -1; }
.field label, .field legend { font-size: 0.9rem; font-weight: 600; padding: 0; }
.optional { font-weight: 400; color: var(--sepia); }
.field input[type="text"], .field input[type="email"], .field select, .field textarea {
  width: 100%;
  font: 400 1rem/1.4 var(--sans);
  color: var(--ink);
  background: var(--paper-field);
  border: 1px solid var(--paper-line);
  border-radius: 2px;
  padding: 0.75rem 0.85rem;
  color-scheme: light;
}
.field textarea { resize: vertical; }
.field input::placeholder, .field textarea::placeholder { color: #8f8066; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--oxblood); outline: 1px solid var(--oxblood); outline-offset: 0; }
.choices { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; padding-top: 0.35rem; }
.choices label { display: inline-flex; align-items: center; gap: 0.5rem; font-weight: 400; font-size: 1rem; cursor: pointer; }
.choices input { accent-color: var(--oxblood); width: 1.05rem; height: 1.05rem; margin: 0; }
.form-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.5rem; margin-top: 0.5rem; }
.form-status { font-size: 0.95rem; color: var(--sepia); }
.form-status.is-ok { color: #2f5b3a; }
.form-status.is-error { color: var(--oxblood); }

/* Footer */
.site-footer { padding-block: 3rem; border-top: 1px solid rgba(201, 162, 74, 0.16); }
.footer-inner { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 1rem 2rem; }
.site-footer a { color: var(--mist-light); text-underline-offset: 0.25em; }
.fine { font-size: 0.85rem; color: var(--mist); }

/* Lightbox */
.lightbox {
  width: 100vw;
  height: 100vh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: clamp(1rem, 4vw, 3rem);
  border: 0;
  background: rgba(10, 13, 24, 0.97);
  color: var(--parchment);
}
.lightbox::backdrop { background: rgba(0, 0, 0, 0.6); }
.lightbox-figure {
  margin: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}
.lightbox-figure img { max-height: calc(100vh - 9rem); width: auto; object-fit: contain; border-radius: 2px; }
.lightbox-figure figcaption { font-family: var(--serif); font-size: 1.3rem; text-align: center; }
.lb-btn {
  position: absolute;
  background: none;
  border: 0;
  color: var(--parchment);
  font: 300 2.75rem/1 var(--serif);
  width: 3rem;
  height: 3rem;
  cursor: pointer;
  opacity: 0.75;
}
.lb-btn:hover { opacity: 1; }
.lb-prev { left: clamp(0.25rem, 2vw, 1.5rem); top: 50%; transform: translateY(-50%); }
.lb-next { right: clamp(0.25rem, 2vw, 1.5rem); top: 50%; transform: translateY(-50%); }
.lb-close { right: clamp(0.25rem, 2vw, 1.5rem); top: clamp(0.25rem, 2vw, 1.5rem); }

/* Tablet */
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-book { justify-self: center; margin-top: 1rem; }
  .credits-list { grid-template-columns: 1fr; gap: 1.5rem; }
  .section-head { grid-template-columns: 1fr; }
  .grid { columns: 2; column-gap: 1.25rem; }
  .packages { grid-template-columns: 1fr; }
  .process { grid-template-columns: 1fr; }
  .terms { grid-column: 1; }
  .about-inner { grid-template-columns: 1fr; }
  .about-photo { max-width: 380px; }
  .brief-inner { grid-template-columns: 1fr; }
}

/* Phone */
@media (max-width: 600px) {
  .nav li:not(:last-child) { display: none; }
  .brief-form { grid-template-columns: 1fr; }
  .piece { margin-bottom: 1.5rem; }
  .piece-title { font-size: 1.05rem; }
  .piece-meta { font-size: 0.78rem; }
  .filters { flex-wrap: nowrap; gap: 1.25rem; overflow-x: auto; scrollbar-width: none; }
  .filter { white-space: nowrap; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .book-3d { animation: none; transition: none; }
  .piece-open img { transition: none; }
}
