/* majoa — shared styles
   Layout: quiet gallery. Bold lowercase logo centred, light airy ground,
   generous whitespace, one olive accent taken from the glaze. */
:root {
  --bg: #f8f7f4;         /* very light warm white, the page ground */
  --surface: #efede8;    /* image placeholders, panels */
  --ink: #2b2623;        /* text */
  --muted: #6a635b;      /* captions and secondary text */
  --line: #e4e1da;       /* hairlines */
  --accent: #6d6b34;     /* olive glaze green */

  --font-logo: "Jost", "Futura", "Avenir Next", "Helvetica Neue", Arial, sans-serif;
  --font-display: "Jost", "Futura", "Avenir Next", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Jost", "Futura", "Avenir Next", "Helvetica Neue", Arial, sans-serif;

  --step--1: 0.8rem;
  --step-0: 1rem;
  --step-1: 1.25rem;
  --step-2: 1.5rem;
  --step-3: 2.1rem;
  --step-4: clamp(2.2rem, 5.2vw, 3.3rem);

  color-scheme: light;
}

* { box-sizing: border-box; }

html { background: var(--bg); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 300;
  font-size: var(--step-0);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding-inline: clamp(16px, 4vw, 40px);
}

/* ---------- Header ---------- */
.site-header {
  display: grid;
  justify-items: center;
  gap: 16px;
  padding-block: 28px 18px;
}
/* Temporary logo: lowercase, tight, bold. Replace with the real one later. */
.logo {
  font-family: var(--font-logo);
  font-weight: 700;
  font-size: clamp(2.6rem, 8vw, 3.8rem);
  letter-spacing: -0.045em;
  text-transform: none;
  text-decoration: none;
  line-height: 1;
}
.nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 36px;
}
.nav a {
  font-size: var(--step--1);
  letter-spacing: 0.24em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--muted);
  padding-block: 10px 6px;
  border-bottom: 1px solid transparent;
  transition: color .2s, border-color .2s;
}
.nav a:hover { color: var(--ink); }
.nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--ink); }

/* ---------- Common type ---------- */
.eyebrow {
  font-size: var(--step--1);
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
}
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 300;
  letter-spacing: -0.025em;
  line-height: 1.12;
  text-wrap: balance;
  margin: 0;
}
h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-2); }
p { margin: 0; }
.lede { font-family: var(--font-display); font-size: var(--step-2); line-height: 1.4; letter-spacing: -0.015em; font-weight: 300; }
.draft-note {
  display: inline-block;
  font-size: var(--step--1);
  color: var(--muted);
  border: 1px dashed var(--line);
  padding: 4px 10px;
  border-radius: 2px;
}

main { padding-block: 16px 96px; }

.button {
  display: inline-block;
  justify-self: start;
  font: inherit;
  font-size: var(--step--1);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-decoration: none;
  background: var(--ink);
  color: var(--bg);
  border: 1px solid var(--ink);
  padding: 12px 26px;
  cursor: pointer;
  transition: background .2s, color .2s;
}
.button:hover { background: transparent; color: var(--ink); }

/* ---------- Home ---------- */
.hero { display: grid; gap: 24px; }
.hero-media {
  display: block;
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--surface);
}
/* To use a video instead of a photo, swap the <img> for a <video> (see index.html);
   the same rules apply to both. */
.hero-media img,
.hero-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 78%;
  transition: transform 1.2s ease;
}
.hero-media:hover img,
.hero-media:hover video { transform: scale(1.02); }
.hero-caption {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 32px;
}
.hero-caption p { font-family: var(--font-display); font-size: var(--step-2); line-height: 1.2; font-weight: 300; letter-spacing: -0.015em; }

@media (max-width: 680px) {
  .hero-media { aspect-ratio: 4 / 5; }
}

/* ---------- Ceramics page ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  gap: 48px 32px;
  padding-top: 24px;
}
.piece {
  display: grid;
  gap: 14px;
  background: none;
  border: 0;
  padding: 0;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
}
.piece-img {
  position: relative;
  aspect-ratio: 4 / 5;
  max-width: 100%;
  overflow: hidden;
  background: var(--surface);
}
.piece-img img { width: 100%; height: 100%; object-fit: cover; transition: opacity .5s ease, transform .6s ease; }
/* second photo fades in on hover */
.piece-img img + img { position: absolute; inset: 0; opacity: 0; }
.piece:hover .piece-img img + img,
.piece:focus-visible .piece-img img + img { opacity: 1; }
.piece-name { font-family: var(--font-body); font-weight: 400; font-size: var(--step--1); letter-spacing: .14em; text-transform: uppercase; line-height: 1.3; }

/* ---------- Piece preview dialog ---------- */
dialog {
  border: 0;
  padding: 0;
  width: min(940px, calc(100% - 32px));
  max-height: calc(100% - 32px);
  overflow: auto;
  background: var(--bg);
  color: var(--ink);
  box-shadow: 0 30px 80px rgba(43, 38, 35, .22);
}
dialog::backdrop { background: rgba(43, 38, 35, .4); }
.detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.detail-media { display: grid; gap: 8px; align-content: start; min-width: 0; }
.detail-media .piece-img { aspect-ratio: 4 / 5; }
.thumbs { display: flex; gap: 8px; padding: 0 8px 8px; }
.thumbs button {
  width: 64px;
  aspect-ratio: 4 / 5;
  padding: 0;
  border: 1px solid transparent;
  background: var(--surface);
  cursor: pointer;
  opacity: .6;
  transition: opacity .2s, border-color .2s;
}
.thumbs button img { width: 100%; height: 100%; object-fit: cover; }
.thumbs button[aria-current="true"] { opacity: 1; border-color: var(--ink); }
.detail-body {
  display: grid;
  align-content: start;
  gap: 18px;
  padding: clamp(24px, 4vw, 48px);
  min-width: 0;
}
.specs { display: grid; grid-template-columns: auto 1fr; gap: 6px 20px; margin: 0; font-size: .92rem; }
.specs dt { color: var(--muted); letter-spacing: .08em; }
.specs dd { margin: 0; }
.close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1;
  width: 40px;
  height: 40px;
  font-size: 1.4rem;
  line-height: 1;
  background: var(--bg);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 50%;
  cursor: pointer;
}

@media (max-width: 680px) {
  .detail { grid-template-columns: 1fr; }
}

/* ---------- About page ---------- */
.about {
  display: grid;
  grid-template-columns: 5fr 6fr;
  gap: clamp(32px, 6vw, 80px);
  align-items: start;
  padding-block: 24px 64px;
}
.about > * { min-width: 0; }
.portrait {
  aspect-ratio: 4 / 5;
  max-width: 100%;
  overflow: hidden;
  background: var(--surface);
}
.portrait img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 55%; }
.prose { display: grid; gap: 20px; max-width: 34rem; }

@media (max-width: 760px) {
  .about { grid-template-columns: 1fr; }
}

/* ---------- Contact page ---------- */
.contact {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: clamp(32px, 6vw, 80px);
  padding-block: 24px 64px;
}
.contact > * { min-width: 0; }
.contact .prose { align-self: start; }
form { display: grid; gap: 20px; }
.field { display: grid; gap: 6px; }
label { font-size: var(--step--1); letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
input, select, textarea {
  font: inherit;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--muted);
  padding: 10px 2px;
  border-radius: 0;
  width: 100%;
}
textarea { min-height: 140px; resize: vertical; border: 1px solid var(--muted); padding: 12px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
.form-status { font-size: .92rem; color: var(--accent); }

@media (max-width: 760px) {
  .contact { grid-template-columns: 1fr; }
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding-block: 28px 44px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: var(--step--1);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}
.site-footer a { display: inline-flex; color: var(--muted); transition: color .2s; }
.site-footer a:hover { color: var(--ink); }
.site-footer svg { width: 22px; height: 22px; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

.direct { margin: 0; color: var(--muted); }
.direct a { color: var(--ink); text-underline-offset: 3px; }

.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
@media (max-width: 680px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 14px; }
}

/* ---------- Filters (Ceramics) ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 4px 28px; padding-top: 12px; }
.filters button {
  font: inherit; font-size: var(--step--1); letter-spacing: .2em; text-transform: uppercase;
  background: none; border: 0; border-bottom: 1px solid transparent; color: var(--muted);
  padding: 12px 0 8px; cursor: pointer; transition: color .2s, border-color .2s;
}
.filters button:hover { color: var(--ink); }
.filters button[aria-pressed="true"] { color: var(--ink); border-bottom-color: var(--ink); }
.piece[hidden] { display: none; }
@media (max-width: 680px) { .filters { gap: 0 22px; } .grid { padding-top: 12px; } }

/* ---------- Phone / touch polish ---------- */
.nav a { padding-block: 14px 10px; min-height: 44px; }
.filters button { padding: 14px 0 10px; min-height: 44px; }
.site-footer a { padding: 11px; margin: -11px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.intro .big { margin: 0; }
dialog { overscroll-behavior: contain; }
@media (max-width: 680px) { .nav { gap: 0 28px; } }
img { height: auto; }
.piece-img img, .portrait img, .teaser img, .thumbs button img, .hero-media img { height: 100%; }
