/* ==========================================================================
   hastialhouei.com
   Rebuilt from the Wix original. Tokens below are measured from the live site
   (Wix --font_N / --color_N variables and computed geometry), not eyeballed.

   Original used Brandon Grotesque Light, licensed to Wix and not
   transferable. Josefin Sans 300 stands in: closest free match by metrics
   (3.2% mean deviation vs Brandon on x-height ratio and advance widths,
   next-closest was 9.5%). To swap in a licensed Brandon, drop the woff2 in
   src/fonts/ and change --sans below -- nothing else needs to move.
   ========================================================================== */

@font-face {
  font-family: 'Josefin Sans';
  src: url('/assets/fonts/JosefinSans-300.woff2') format('woff2');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

:root {
  --sans: 'Josefin Sans', 'Century Gothic', 'Avenir Next', sans-serif;
  --serif: 'Times New Roman', times, serif;

  --ink: #414141;         /* Wix color_37 - headings, body, wordmark */
  --muted: #636363;       /* Wix color_40 - nav, footer */
  --faint: #999999;
  --rule: #d6d6d4;
  --bg: #ffffff;
  --band: #e0e0e0;        /* contact page grey band */

  --canvas: 980px;        /* Wix fixed canvas width */
  --measure: 793px;       /* text column width, measured */
  --hero: 760px;          /* home slideshow width, measured */
  --plate: 720px;         /* artwork image width, measured */
  --rail: 64px;           /* fixed left rail offset */
  --rail-w: 190px;
  --header-h: 129px;

  --step: 1.4;            /* body line-height (measured 25.2px @ 18px) */
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 300 16px/var(--step) var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a { color: inherit; text-decoration: none; }

:where(a, button, input, select, textarea):focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

.skip {
  position: absolute; left: -9999px; top: 0;
  background: #fff; color: var(--ink); padding: 12px 18px; z-index: 100;
}
.skip:focus { left: 8px; top: 8px; }

/* --- wordmark + rail nav (fixed on desktop, as the original) -------------- */

.wordmark {
  position: fixed;
  left: var(--rail);
  top: 47px;
  z-index: 20;
  font: 400 28px/1.4 var(--serif);
  color: var(--ink);
}

.rail {
  position: fixed;
  left: var(--rail);
  top: 182px;
  z-index: 20;
  width: var(--rail-w);
}

.rail ul { list-style: none; margin: 0; padding: 0; }

.rail a {
  display: block;
  font: 300 15px/33px var(--sans);
  color: var(--muted);
  transition: color .18s ease;
}

.rail a:hover,
.rail a[aria-current='page'] { color: var(--ink); }

.nav-toggle { display: none; }

/* --- page shell ---------------------------------------------------------- */

.page {
  max-width: var(--canvas);
  margin: 0 auto;
  padding: var(--header-h) 10px 0;
}

.page--wide { max-width: none; padding-left: 0; padding-right: 0; }

.site-footer {
  max-width: var(--canvas);
  margin: 0 auto;
  padding: 40px 20px 34px;
  font: 300 14px/1.4 var(--sans);
  color: var(--muted);
}

/* --- type ---------------------------------------------------------------- */

h1, h2, h3 { font-weight: 300; margin: 0; }

/* Wix set --font_0 at 1.4em; Brandon's `normal` line-height computes to ~1.45
   (81px box at 56px), Josefin's to ~1.0. Pinned explicitly so heading blocks
   are the same height as the original and everything below lines up. */
.h-display {
  font: 300 56px/1.45 var(--sans);
  color: var(--ink);
  letter-spacing: 0;
}

.h-piece {
  font: 400 30px/1.4 var(--serif);
  color: var(--ink);
}

.lede, .prose p {
  font: 300 18px/var(--step) var(--sans);
  color: var(--ink);
  margin: 0 0 1.5em;
}

/* Artwork metadata: italic serif at 18px/1.8 in a 564px centred column --
   measured on the original (32.4px line box, x=518 w=564 at 1600px). */
.meta {
  font: italic 400 18px/1.8 var(--serif);
  color: var(--ink);
  margin: 0 auto;
  max-width: 564px;
}
.meta span { display: block; }

.center { text-align: center; }

/* Top offset below the fixed header differs per page in the original. */
.h-display[data-top] { margin-top: 0; }
.page > .h-display:first-child { margin-top: var(--h1-top, 0); }

.prose { max-width: var(--measure); }
.prose p:last-child { margin-bottom: 0; }

/* --- home slideshow ------------------------------------------------------ */

.slideshow { position: relative; margin: 0 auto 18px; max-width: var(--hero); }

.slides {
  display: flex;
  margin: 0;              /* it's a <ul> -- kill the UA margin/padding */
  padding: 0;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  gap: 0;
  scrollbar-width: none;
}
.slides::-webkit-scrollbar { display: none; }

.slides li {
  list-style: none;
  flex: 0 0 100%;
  scroll-snap-align: center;
}
.slides img { width: 100%; aspect-ratio: 760 / 459; object-fit: cover; }

.slide-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px; height: 44px;
  border: 0; border-radius: 50%;
  background: rgba(255,255,255,.86);
  color: var(--ink);
  font-size: 18px; line-height: 1;
  cursor: pointer;
  display: grid; place-items: center;
  box-shadow: 0 1px 6px rgba(0,0,0,.12);
  transition: background .18s ease;
}
.slide-btn:hover { background: #fff; }
.slide-btn[hidden] { display: none; }
.slide-prev { left: 14px; }
.slide-next { right: 14px; }

.thumbs {
  display: flex;
  gap: 18px;
  max-width: var(--hero);
  overflow-x: auto;
  padding: 0;
  margin: 0 auto;
  scrollbar-width: none;
}
.thumbs::-webkit-scrollbar { display: none; }
.thumbs li { list-style: none; flex: 0 0 auto; }
.thumbs button {
  padding: 0; border: 0; background: none; cursor: pointer;
  width: 90px; height: 90px;
  opacity: .55; transition: opacity .18s ease;
}
.thumbs button[aria-current='true'], .thumbs button:hover { opacity: 1; }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }

/* --- galleries ----------------------------------------------------------- */
/* Justified rows, matching the original Pro Gallery: every row fills the full
   width, tiles keep their aspect ratio, one shared height per row. Row widths
   are computed at build time and emitted as flex-basis percentages, so the
   proportions survive at any viewport. */

/* the gallery spans the full 980 canvas, wider than the padded text column */
.gallery { margin: 48px -10px 0; display: grid; gap: 60px; }

.gallery .grow {
  display: flex;
  gap: 60px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.gallery li { min-width: 0; }

.tile { display: block; }
.tile img { width: 100%; transition: opacity .22s ease; }
.tile:hover img { opacity: .82; }
.tile figcaption {
  font: 300 14px/1.5 var(--sans);
  color: var(--muted);
  margin-top: 10px;
}

/* --- bio ----------------------------------------------------------------- */

/* Measured on the original at 1600px: block 727 wide centred (x=442), sitting
   97px below the header, with the text column starting 11px lower than the
   image. */
.bio-grid {
  display: grid;
  grid-template-columns: 386fr 299fr;
  gap: 42px;
  max-width: 727px;
  margin: 97px auto 0;
  align-items: start;
}

/* bio runs at 16px where the rest of the site runs at 18px */
.bio-grid .prose p { font-size: 16px; }
.bio-grid .prose { padding-top: 11px; }

/* --- available work ------------------------------------------------------ */

/* Full-bleed band starting below the header, with the copy card lapping over
   its lower edge -- measured from the original: band y=129 h=446, card top 310. */
.band-hero {
  position: relative;
  margin-top: var(--header-h);
  margin-bottom: 56px;
}
.band-hero img { width: 100%; height: 446px; object-fit: cover; }
.band-hero .band-card {
  background: #fff;
  max-width: 854px;
  margin: -265px auto 0;
  position: relative;
  padding: 50px 52px;
}

/* the page block that follows a full-bleed band already clears the header */
.page--after-band { padding-top: 0; }

.pieces { display: grid; gap: 76px; margin-top: 56px; max-width: 802px; margin-inline: auto; }
.piece { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; align-items: center; }
.piece-media img { max-width: 280px; }
.piece:nth-child(even) .piece-media { justify-self: end; }
.piece:nth-child(even) .piece-media { order: 2; }
.piece-meta p { margin: 0 0 .4em; font: 300 16px/var(--step) var(--sans); }
.piece-meta .h-piece { margin-bottom: .5em; }
.piece-link { font: 300 15px/1.6 var(--sans); color: var(--muted); border-bottom: 1px solid var(--rule); display: inline-block; margin-top: 14px; }
.piece-link:hover { color: var(--ink); }

.plate { max-width: var(--plate); margin-inline: auto; }

.rule { border: 0; border-top: 1px solid var(--rule); margin: 0; }


/* --- commissions -------------------------------------------------------- */
/* Measured from the original: copy column 629px at 18px/1.8, hero inset 80px
   each side at 431px tall, and the form on white (only Contact gets a band). */

.prose--airy { max-width: 629px; line-height: 1.8; }
.prose--airy p { line-height: 1.8; }

.hero-inset { padding: 0 80px; margin: 49px 0 108px; }
.hero-inset img { width: 100%; height: 431px; object-fit: cover; }

.form-band.form-plain { background: none; padding: 0; margin-top: 107px; }
.form-band.form-plain .form-inner { max-width: 629px; padding: 0; }
.commission-form .btn { width: 280px; }

/* --- forms --------------------------------------------------------------- */

/* Contact's band is inset 40px each side and translucent, not full-bleed. */
.form-band { background: rgba(214, 214, 212, .8); padding: 49px 0 316px; margin: 32px 40px 0; }
.form-inner { max-width: 790px; margin: 0 auto; padding: 0; }

.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px 20px; }
.field { display: flex; flex-direction: column; }
.field--full { grid-column: 1 / -1; }

.field label {
  font: 300 14px/1 var(--sans);
  color: var(--ink);
  margin-bottom: 9px;
}

.field input, .field select, .field textarea {
  font: 300 16px/1.5 var(--sans);
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--ink);
  border-radius: 0;
  padding: 6px 10px;
  width: 100%;
}
.field textarea { min-height: 86px; resize: vertical; }
.field select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 34px; }

.form-actions { display: flex; justify-content: flex-end; margin-top: 15px; }

.btn {
  font: 300 14px/1 var(--sans);
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--muted);
  padding: 11px 0;
  width: 250px;
  cursor: pointer;
  transition: background .18s ease, color .18s ease;
}
.btn:hover { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn[disabled] { opacity: .5; cursor: default; }

.form-status { font: 300 14px/1.5 var(--sans); margin-top: 14px; text-align: right; }
.form-status[data-state='error'] { color: #9c3b3b; }

.commission-form { margin-top: 40px; }
.commission-form .form-grid { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 20px 41px; }


/* --- article pages (collections, guides, process) ------------------------- */

.h-sub {
  font: 300 30px/1.4 var(--sans);
  color: var(--ink);
  margin: 1.6em 0 .5em;
}

.faq { border-bottom: 1px solid var(--rule); padding: 14px 0; }
.faq summary {
  font: 300 18px/1.5 var(--sans);
  color: var(--ink);
  cursor: pointer;
  list-style: none;
  position: relative;
  padding-right: 30px;
}
.faq summary::after {
  content: '+'; position: absolute; right: 4px; top: 0;
  color: var(--muted); font-size: 22px; transition: transform .18s ease;
}
.faq[open] summary::after { transform: rotate(45deg); }
.faq p { margin: 12px 0 4px; }

.cta { text-align: center; margin: 64px auto 0; max-width: 629px; }
.cta p { font: 300 18px/1.6 var(--sans); margin-bottom: 18px; }
.btn--link { display: inline-block; text-decoration: none; }

.footer-nav { font: 300 13px/1.8 var(--sans); color: var(--muted); margin-bottom: 10px; }
.footer-nav a:hover { color: var(--ink); }


/* --- artwork note + home intro ------------------------------------------- */

.artwork-note { margin: 36px auto 0; }
.artwork-note p { color: var(--muted); }

.home-intro {
  max-width: var(--hero);
  margin: 34px auto 0;
  text-align: center;
}
.home-intro p { font: 300 16px/1.7 var(--sans); color: var(--muted); margin: 0 0 10px; }
.home-intro-links { font-size: 15px; }
.home-intro-links a { margin: 0 6px; }

/* --- responsive ---------------------------------------------------------- */
/* The original never adapted: below ~1100px the fixed rail overlapped the
   artwork and the 980px canvas simply overflowed. Rebuilt properly here. */

@media (max-width: 1180px) {
  :root { --header-h: 96px; }

  .wordmark { position: static; }
  .rail { position: static; width: auto; }

  .topbar {
    position: sticky; top: 0; z-index: 30;
    background: rgba(255,255,255,.96);
    backdrop-filter: blur(6px);
    border-bottom: 1px solid var(--rule);
    padding: 16px 20px;
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap;   /* lets the open menu take a row of its own */
    gap: 16px;
  }
  .topbar .wordmark { font-size: 24px; }

  .nav-toggle {
    display: grid; place-items: center;
    width: 42px; height: 42px;
    border: 1px solid var(--rule); background: #fff; cursor: pointer;
  }
  .nav-toggle span { display: block; width: 18px; height: 1px; background: var(--ink); position: relative; }
  .nav-toggle span::before, .nav-toggle span::after {
    content: ''; position: absolute; left: 0; width: 18px; height: 1px; background: var(--ink);
  }
  .nav-toggle span::before { top: -6px; }
  .nav-toggle span::after { top: 6px; }

  .rail { display: none; width: 100%; }
  .rail[data-open='true'] { display: block; }
  .topbar .rail {
    order: 3; flex-basis: 100%;
    border-top: 1px solid var(--rule); margin-top: 14px; padding-top: 8px;
  }
  .rail a { font-size: 17px; line-height: 46px; }

  .page { padding-top: 40px; }
  .bio-grid, .piece { grid-template-columns: 1fr; gap: 28px; }
  /* the desktop offsets are pixel-matching, not design — drop them when stacked */
  .bio-grid { margin-top: 0; max-width: none; }
  .bio-grid .prose { padding-top: 0; }
  .piece:nth-child(even) .piece-media { order: 0; }
  .form-grid, .commission-form .form-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .band-hero .band-card { margin-top: -80px; padding: 32px 28px; }
  .form-band { margin-left: 0; margin-right: 0; }
  .form-inner { padding: 0 18px; }
  .form-band { padding-bottom: 56px; }
  .hero-inset { padding: 0; }
  .hero-inset img { height: 300px; }
  .h-display { font-size: 42px; }
  .gallery, .gallery .grow { gap: 28px; }
  .gallery { margin-inline: 0; }
}

@media (max-width: 640px) {
  .page { padding-left: 18px; padding-right: 18px; }
  .h-display { font-size: 34px; }
  .h-piece { font-size: 24px; }
  .meta { font-size: 16px; }
  .form-grid, .commission-form .form-grid { grid-template-columns: 1fr; }
  .form-actions { justify-content: stretch; }
  .btn, .commission-form .btn { width: 100%; }
  /* justified rows get too thin on a phone -- wrap to two per row */
  .gallery .grow { flex-wrap: wrap; gap: 14px; }
  .gallery .grow li { flex: 1 1 calc(50% - 7px) !important; }
  .gallery { gap: 14px; }
  .band-hero img { height: 220px; }
  .hero-inset img { height: 200px; }
  .band-hero .band-card { margin-top: -50px; padding: 26px 20px; }
  .site-footer { padding-left: 18px; padding-right: 18px; }
}

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

@media print {
  .rail, .nav-toggle, .slide-btn, .thumbs, .form-band { display: none; }
}
