/* Caliray — gallery-first, quiet. The photographs are the design. */

:root {
  --bg: #f6f6f5;
  --text: #1c1c1c;
  --muted: #6b6b6b;
  --line: #e0e0de;
  --tile-bg: #ebebe9;
  --gap: 20px;
  --pad: clamp(16px, 4vw, 48px);
  --max: 1440px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1rem/1.6 var(--font);
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover,
a:focus-visible {
  text-decoration: underline;
  text-underline-offset: 3px;
}

h1,
h2 {
  font-weight: 400;
  line-height: 1.2;
  margin: 0;
}

h1 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  letter-spacing: -0.01em;
}

.wrap {
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--pad);
}

.block {
  margin-block: clamp(48px, 7vw, 96px);
}

.section-h {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  margin-bottom: 24px;
}

/* One short line under a section heading (Signature on the home page). */
.section-h:has(+ .section-intro) {
  margin-bottom: 8px;
}

.section-intro {
  margin: 0 0 24px;
  color: var(--muted);
}

.lede {
  font-size: 1.15rem;
  color: var(--muted);
  max-width: 40em;
  margin: 12px 0 0;
}

/* Visible to screen readers and search engines only (the home page h1). */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: absolute;
  left: -9999px;
}

.skip:focus {
  left: 8px;
  top: 8px;
  background: var(--bg);
  padding: 8px 12px;
  z-index: 10;
}

/* ---------- Header and navigation ---------- */

.site-header {
  max-width: var(--max);
  margin-inline: auto;
  padding: 20px var(--pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.wordmark {
  font-size: 1.05rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}

/* The full title is long; tighten it so it stays on one line on phones. */
@media (max-width: 520px) {
  .wordmark {
    font-size: 0.8rem;
    letter-spacing: 0.14em;
  }
}

.site-nav ul,
.site-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 28px;
}

.site-nav a {
  font-size: 0.95rem;
  color: var(--muted);
}

.site-nav a[aria-current="page"],
.site-nav a:hover {
  color: var(--text);
}

.site-nav a[aria-current="page"] {
  text-decoration: underline;
  text-underline-offset: 6px;
}

/* "Prints" dropdown: opens on hover or keyboard focus on desktop. */
.has-sub {
  position: relative;
}

.sub-parent::after {
  content: " ▾";
  font-size: 0.75em;
}

.sub-parent[data-current] {
  color: var(--text);
}

.site-nav .sub {
  display: none;
  position: absolute;
  top: 100%;
  left: -16px;
  z-index: 20;
  min-width: 200px;
  padding: 12px 16px;
  margin-top: 0;
  flex-direction: column;
  gap: 0;
  background: var(--bg);
  border: 1px solid var(--line);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.site-nav .sub a {
  display: block;
  padding: 6px 0;
}

.has-sub:hover .sub,
.has-sub:focus-within .sub {
  display: flex;
}

/* Thin rule between Signature and the collections. */
.site-nav .sub-divider {
  border-top: 1px solid var(--line);
  margin: 6px 0;
}

/* Section headings that link (Signature on the home page) keep the heading look. */
.section-h a {
  color: inherit;
  text-decoration: none;
}

.section-h a:hover {
  color: var(--text);
}

/* A hover bridge so the menu doesn't close crossing the gap below "Prints". */
.has-sub::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 10px;
}

.nav-toggle {
  display: none;
  font: inherit;
  font-size: 0.95rem;
  background: none;
  border: 0;
  padding: 8px 0;
  color: var(--text);
  cursor: pointer;
}

@media (max-width: 760px) {
  .js .nav-toggle {
    display: block;
  }
  .js .site-nav {
    display: none;
    width: 100%;
  }
  .js .site-nav.is-open {
    display: block;
  }
  .site-nav ul {
    flex-direction: column;
    gap: 0;
    padding-bottom: 8px;
  }
  .site-nav a {
    display: block;
    padding: 10px 0;
    font-size: 1.05rem;
    border-top: 1px solid var(--line);
  }
  /* In the mobile menu "Prints" is a heading over its links. */
  .sub-parent::after {
    content: "";
  }
  .site-nav .sub-parent {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    padding-top: 14px;
  }
  .site-nav .sub,
  .has-sub:hover .sub,
  .has-sub:focus-within .sub {
    display: flex;
    position: static;
    min-width: 0;
    padding: 0 0 0 16px;
    border: 0;
    box-shadow: none;
  }
  .has-sub::after {
    content: none;
  }
  .site-nav .sub-divider {
    margin: 0;
    height: 10px;
    border-top: 1px solid var(--line);
  }
}

/* ---------- Justified grid ----------
   Each tile's width is proportional to its aspect ratio (--r), so every tile in a
   row has the same height and no image is cropped. The ::after spacer keeps the
   last row from stretching. */

.jgrid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--gap);
}

.jgrid::after {
  content: "";
  flex: 1000000000 1 0;
}

/* Once site.js has balanced the rows, every row (the last too) fills the width. */
.jgrid.is-justified::after {
  content: none;
}

.jgrid.is-justified .tile img {
  height: var(--h, auto);
  object-fit: cover;
}

/* Grow is scaled by 100 because a line whose grow factors sum to less than 1
   (a lone portrait tile, r = 0.75) would only get that fraction of the space. */
.tile {
  flex: calc(var(--r) * 100) 1 calc(var(--r) * var(--row));
  min-width: 0;
}

.tile a {
  display: block;
}

.tile img {
  width: 100%;
}

/* ---------- Blur-up loading ----------
   The 800px file shows blurred behind each photograph until it has loaded, then
   the photograph fades in over it (site.js adds .is-loaded). */

.frame {
  display: block;
  position: relative;
  overflow: hidden;
  background: var(--tile-bg);
}

.frame::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--lq) center / cover no-repeat;
  filter: blur(14px);
  transform: scale(1.08);
}

.frame img {
  position: relative;
}

.js .frame img {
  opacity: 0;
  transition: opacity 0.5s ease;
}

.js .frame img.is-loaded {
  opacity: 1;
}

.tile-title,
.tile-meta {
  display: block;
  font-size: 0.9rem;
}

.tile-title {
  margin-top: 10px;
}

.tile-meta {
  color: var(--muted);
}

@media (max-width: 640px) {
  :root {
    --gap: 12px;
  }
  .tile {
    flex-basis: 100%;
  }
}

/* ---------- Home ---------- */

.hero-full {
  position: relative;
  height: 75vh;
  min-height: 380px;
  overflow: hidden;
}

.frame-hero {
  position: absolute;
  inset: 0;
}

.frame-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-overlay {
  position: absolute;
  inset: auto 0 0 0;
  padding: 120px var(--pad) clamp(24px, 4vw, 48px);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0));
  color: #fff;
}

.hero-title {
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.btn.btn-light {
  background: #fff;
  color: var(--text);
}

.btn.btn-light:hover {
  background: #eaeae8;
  text-decoration: none;
}

.intro {
  text-align: center;
  margin-top: clamp(32px, 5vw, 56px);
}

.intro .lede {
  margin-inline: auto;
}

.text-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 28px;
  margin: 20px 0 0;
}

.text-links a {
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* Collection cards: four equal 4:5 cards, 2 x 2, or 4 across on wide screens. */
.cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--gap);
}

@media (min-width: 900px) {
  .cards {
    grid-template-columns: repeat(4, 1fr);
  }
}

.cards a {
  display: block;
}

.frame-card {
  aspect-ratio: 4 / 5;
}

.frame-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cards .tile-title {
  font-size: 1.05rem;
}

/* Trust strip */
.trust-cols {
  display: grid;
  gap: 32px;
  border-top: 1px solid var(--line);
  padding-top: 40px;
}

@media (min-width: 760px) {
  .trust-cols {
    grid-template-columns: repeat(3, 1fr);
    gap: 48px;
  }
}

.trust h3 {
  font-size: 1.05rem;
  font-weight: 500;
  margin: 0 0 8px;
}

.trust p {
  margin: 0;
  color: var(--muted);
}

.trust .text-links {
  justify-content: flex-start;
  margin-top: 32px;
}

.statement p {
  max-width: 34em;
  margin: 0 auto;
  text-align: center;
  font-size: 1.2rem;
  line-height: 1.7;
}

/* ---------- Collection and all-prints pages ---------- */

.page-head {
  margin-top: clamp(24px, 5vw, 64px);
}

.page-head + .block {
  margin-top: 40px;
}

[hidden] {
  display: none !important;
}

/* ---------- Print page ---------- */

.print-hero {
  margin: 0;
  padding: 0 var(--pad);
}

/* The large image is never cropped: its frame is as wide as the column allows
   without the image getting taller than the screen. */
.frame-large {
  width: min(100%, calc((100vh - 120px) * var(--r)));
  margin-inline: auto;
}

.frame-large img {
  width: 100%;
}

/* Print page: title (head), notes and What arrives (info), order panel, scale
   preview. Spacing comes from margins, not grid gaps, so the title and the notes
   read as one block wherever they sit. */
.print-detail {
  margin-top: 40px;
  display: grid;
  gap: 0;
  grid-template-areas: "head" "info" "order" "scale";
}

.print-head {
  grid-area: head;
}

.print-info {
  grid-area: info;
  margin-bottom: 40px;
}

.print-order {
  grid-area: order;
  margin-bottom: 40px;
}

.print-scale {
  grid-area: scale;
}

/* Phones: the order panel goes straight under the title. */
@media (max-width: 767px) {
  .print-detail {
    grid-template-areas: "head" "order" "info" "scale";
  }
  .print-head {
    margin-bottom: 24px;
  }
  .print-order {
    margin-bottom: 16px;
  }
}

@media (min-width: 900px) {
  .print-detail {
    grid-template-columns: 1fr 1fr;
    grid-template-areas: "head order" "info order" "scale order";
    grid-template-rows: auto auto 1fr;
    column-gap: 72px;
    row-gap: 0;
  }
  .print-order {
    margin-bottom: 0;
  }
}

.notes {
  margin-top: 24px;
  color: var(--muted);
}

.notes p {
  margin: 0 0 10px;
}

.arrives {
  margin-top: 24px;
  color: var(--muted);
  font-size: 0.95rem;
}

.arrives h2 {
  font-size: 1rem;
  color: var(--text);
  margin: 0 0 8px;
}

.arrives dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  column-gap: 16px;
  row-gap: 6px;
  margin: 0;
}

.arrives dt {
  font-weight: 600;
}

.arrives dd {
  margin: 0;
}

.arrives p {
  margin: 10px 0 0;
}

.notes-links {
  font-size: 0.9rem;
  margin: 8px 0 0;
}

.notes-links a,
.hint a,
.prose a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Order panel */

.order fieldset {
  border: 0;
  margin: 0 0 24px;
  padding: 0;
}

.order legend,
.contact legend {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  padding: 0;
  margin-bottom: 12px;
}

.opts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.opt {
  position: relative;
  cursor: pointer;
}

.opt input {
  position: absolute;
  opacity: 0;
  inset: 0;
  margin: 0;
  cursor: pointer;
}

.opt span {
  display: block;
  padding: 9px 16px;
  border: 1px solid var(--line);
  font-size: 0.95rem;
  background: #fff;
}

.opt input:checked + span {
  border-color: var(--text);
  box-shadow: inset 0 0 0 1px var(--text);
}

.opt input:focus-visible + span {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}

.hint {
  font-size: 0.875rem;
  color: var(--muted);
  margin: 12px 0 0;
}

.price {
  font-size: 1.6rem;
  margin: 8px 0 0;
}

.price-note {
  margin: 4px 0 20px;
  color: var(--muted);
  font-size: 0.9rem;
}

.btn {
  font: inherit;
  font-size: 1rem;
  background: var(--text);
  color: #fff;
  border: 0;
  padding: 14px 28px;
  cursor: pointer;
}

.btn:hover {
  background: #000;
}

.btn:disabled {
  opacity: 0.6;
  cursor: default;
}

/* Scale preview */

.scale {
  margin: 0;
  max-width: 560px;
}

.scale svg {
  display: block;
  width: 100%;
  height: auto;
  background: #efefed;
}

.scale-sofa rect {
  fill: #cfcdc8;
}

.scale-floor {
  stroke: #cfcdc8;
  stroke-width: 0.4;
}

.scale-frame {
  fill: none;
  stroke: #444;
  stroke-width: 0.3;
}

.scale figcaption {
  margin-top: 10px;
  font-size: 0.875rem;
  color: var(--muted);
}

.crumb {
  margin: 0 0 8px;
  font-size: 0.9rem;
  color: var(--muted);
}

.subtitle {
  margin: 8px 0 0;
  color: var(--muted);
}

.print-panel {
  border-top: 1px solid var(--line);
  padding-top: 20px;
  color: var(--muted);
}

.print-panel p {
  margin: 0;
}

.pager {
  margin-top: 56px;
  display: flex;
  justify-content: space-between;
  gap: 24px;
}

.pager a {
  max-width: 45%;
}

.pager .next {
  text-align: right;
}

.pager span {
  display: block;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.more .section-h a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- Info pages ---------- */

.narrow {
  max-width: 760px;
}

.prose p,
.prose-wide p {
  margin: 0 0 1em;
}

.prose-wide {
  max-width: 980px;
  margin-inline: auto;
}

.prose h2 {
  font-size: 1.2rem;
  margin: 40px 0 12px;
}

.prose section:first-child h2 {
  margin-top: 0;
}

.page-head.narrow + .prose,
.page-head + .prose-wide {
  margin-top: 32px;
}

.media-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  margin: 24px 0 56px;
}

.media-links a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.medium {
  display: grid;
  gap: 32px;
  padding-block: clamp(48px, 7vw, 88px);
  border-top: 1px solid var(--line);
  scroll-margin-top: 16px;
}

.medium:first-child {
  margin-top: clamp(48px, 7vw, 88px);
}

@media (min-width: 900px) {
  .medium {
    grid-template-columns: 1fr 1fr;
    gap: 72px;
  }
}

.medium h2 {
  font-size: 1.5rem;
  margin-bottom: 16px;
}

.medium h3 {
  font-size: 0.8rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  margin: 32px 0 16px;
}

.medium-photo {
  width: 100%;
}

.frames {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.frames figure {
  margin: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  font-size: 0.85rem;
  color: var(--muted);
}

.frames img {
  width: 100%;
  margin-bottom: 8px;
}

/* Contact and order form */

.contact {
  display: grid;
  gap: 20px;
  margin-top: 32px;
}

.contact fieldset {
  border: 0;
  border-bottom: 1px solid var(--line);
  margin: 0;
  padding: 0 0 24px;
  display: grid;
  gap: 16px;
}

.contact label {
  display: grid;
  gap: 6px;
  font-size: 0.95rem;
}

.contact input,
.contact select,
.contact textarea {
  font: inherit;
  padding: 10px 12px;
  border: 1px solid #c9c9c6;
  background: #fff;
  color: var(--text);
  border-radius: 0;
  width: 100%;
}

.contact input:focus,
.contact select:focus,
.contact textarea:focus {
  outline: 2px solid var(--text);
  outline-offset: 0;
}

.field-row {
  display: grid;
  gap: 16px;
}

@media (min-width: 560px) {
  .field-row {
    grid-template-columns: 1fr 1fr;
  }
}

.optional {
  color: var(--muted);
  font-size: 0.85rem;
}

.order-preview {
  display: flex;
  gap: 16px;
  align-items: center;
}

.order-preview img {
  width: 120px;
  height: auto;
  background: var(--tile-bg);
}

.order-preview p {
  margin: 0;
  font-size: 1.1rem;
}

.contact .btn {
  justify-self: start;
}

.form-status {
  margin: 0;
  color: var(--muted);
  min-height: 1.6em;
}

.form-status.is-error {
  color: #b42318;
}

.form-sent {
  margin-top: 32px;
}

/* ---------- Footer ---------- */

.site-footer {
  max-width: var(--max);
  margin: clamp(64px, 9vw, 128px) auto 0;
  padding: 32px var(--pad) 48px;
  border-top: 1px solid var(--line);
  font-size: 0.875rem;
  color: var(--muted);
}

.site-footer p {
  margin: 20px 0 0;
}

.site-footer .footer-line {
  color: var(--text);
}

/* ---------- Printing: ordering steps ---------- */

.ordering {
  margin: 48px 0 56px;
}

.ordering h2 {
  font-size: 1.4rem;
  margin-bottom: 16px;
}

.ordering ol {
  margin: 0;
  padding-left: 1.4em;
}

.ordering li {
  margin: 6px 0;
}

/* ---------- Preview builds only: outline copy awaiting approval ---------- */

.is-preview .ph {
  outline: 1px dashed #b07a1f;
  outline-offset: 6px;
}

.is-preview span.ph {
  outline-offset: 1px;
}

/* "Last updated" line on Terms of sale and Privacy */
.updated {
  color: var(--muted);
  font-size: 0.9rem;
}
