/* Suren Studio — surenstudio.com
   Type and spacing follow Apple's HIG conventions: system faces, an 8pt
   rhythm, generous white space, and colour that gets out of the way of
   the paintings. */

:root {
  color-scheme: light dark;

  --font-display: ui-serif, "New York", "Iowan Old Style", Palatino, "Times New Roman", serif;
  --font-ui: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", system-ui, sans-serif;

  --bg: #fbfaf8;
  --bg-elevated: #ffffff;
  --bg-sunken: #f2f0ec;
  --ink: #17161a;
  --ink-muted: #6b675f;
  --ink-faint: #9b968c;
  --hairline: rgba(23, 22, 26, 0.12);
  --accent: #8a6a3b;
  --accent-soft: rgba(138, 106, 59, 0.12);
  --shadow-soft: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 30px rgba(0, 0, 0, 0.06);
  --shadow-lift: 0 2px 6px rgba(0, 0, 0, 0.06), 0 24px 60px rgba(0, 0, 0, 0.12);

  --step-0: 1rem;
  --step-1: 1.125rem;
  --step-2: clamp(1.35rem, 1.1rem + 0.9vw, 1.75rem);
  --step-3: clamp(1.75rem, 1.3rem + 1.8vw, 2.6rem);
  --step-4: clamp(2.4rem, 1.5rem + 3.6vw, 4.75rem);

  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 40px;
  --space-5: 64px;
  --space-6: 96px;
  --space-7: 144px;

  --radius: 14px;
  --radius-lg: 22px;
  --gutter: clamp(20px, 5vw, 64px);
  --measure: 62ch;
  --ease: cubic-bezier(0.32, 0.72, 0, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c0c0e;
    --bg-elevated: #151517;
    --bg-sunken: #08080a;
    --ink: #f3f1ed;
    --ink-muted: #a09b92;
    --ink-faint: #6f6b64;
    --hairline: rgba(243, 241, 237, 0.14);
    --accent: #d9b679;
    --accent-soft: rgba(217, 182, 121, 0.16);
    --shadow-soft: 0 1px 2px rgba(0, 0, 0, 0.5), 0 8px 30px rgba(0, 0, 0, 0.45);
    --shadow-lift: 0 2px 6px rgba(0, 0, 0, 0.5), 0 24px 60px rgba(0, 0, 0, 0.6);
  }
}

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

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

/* The header is sticky, so anything jumped to by id has to clear it. */
:target, [id] { scroll-margin-top: 84px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: var(--step-0);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

/* Several components below set display on elements that are toggled with the
   hidden attribute, which would otherwise win. */
[hidden] { display: none !important; }
a { color: inherit; }

h1, h2, h3 { font-family: var(--font-display); font-weight: 500; letter-spacing: -0.015em; line-height: 1.1; margin: 0; }
p { margin: 0 0 1em; }

::selection { background: var(--accent-soft); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--ink); color: var(--bg);
  padding: 12px 18px; border-radius: 0 0 var(--radius) 0;
}
.skip-link:focus { left: 0; }

.wrap {
  width: 100%; max-width: 1240px; margin-inline: auto;
  /* viewport-fit=cover lets the page run under the notch and home indicator, so
     the gutters have to clear the safe area on a landscape iPhone. */
  padding-left: max(var(--gutter), env(safe-area-inset-left));
  padding-right: max(var(--gutter), env(safe-area-inset-right));
}
.narrow { max-width: 760px; }

/* ---------- Preview banner (placeholder content only) ---------- */

.preview-bar {
  background: var(--accent-soft);
  color: var(--ink);
  font-size: 0.8125rem;
  letter-spacing: 0.01em;
  text-align: center;
  padding: 9px var(--space-2);
  border-bottom: 1px solid var(--hairline);
}
.preview-bar strong { font-weight: 600; }
/* On a phone the banner should cost one line, not a third of the first screen. */
@media (max-width: 620px) {
  .preview-bar { font-size: 0.75rem; padding: 7px 14px; }
  .preview-bar .preview-detail { display: none; }
}

/* ---------- Header ---------- */

.site-header {
  position: sticky; top: 0; z-index: 40;
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease);
}
.site-header[data-scrolled="true"] { border-bottom-color: var(--hairline); }

.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-3); min-height: 64px;
}

.wordmark {
  font-family: var(--font-display);
  font-size: 1.375rem;
  letter-spacing: 0.02em;
  text-decoration: none;
  display: inline-flex; align-items: baseline; gap: 10px;
}
.wordmark span { font-family: var(--font-ui); font-size: 0.6875rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-faint); }

.nav { display: flex; align-items: center; gap: clamp(14px, 2.4vw, 30px); }
.nav a {
  text-decoration: none; font-size: 0.9375rem; color: var(--ink-muted);
  transition: color 0.2s var(--ease);
  /* 44pt tap targets, per the HIG. */
  display: inline-flex; align-items: center; min-height: 44px;
}
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); }
@media (max-width: 560px) { .nav a.nav-optional { display: none; } }

/* ---------- Buttons ---------- */

.btn {
  --btn-bg: var(--ink);
  --btn-fg: var(--bg);
  appearance: none; border: 0; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--btn-bg); color: var(--btn-fg);
  font: inherit; font-size: 0.9375rem; font-weight: 500;
  padding: 12px 22px; border-radius: 980px;
  text-decoration: none; white-space: nowrap;
  transition: transform 0.2s var(--ease), opacity 0.2s var(--ease), background 0.2s var(--ease);
}
.btn:hover { opacity: 0.86; }
.btn:active { transform: scale(0.97); }
.btn[disabled] { opacity: 0.4; cursor: not-allowed; }
.btn-secondary { --btn-bg: transparent; --btn-fg: var(--ink); box-shadow: inset 0 0 0 1px var(--hairline); }
.btn-secondary:hover { background: var(--bg-sunken); opacity: 1; }
.btn-small { padding: 8px 16px; font-size: 0.875rem; }

/* ---------- Hero ---------- */

.hero { padding: clamp(48px, 9vw, 128px) 0 var(--space-5); }
.hero-inner { display: grid; gap: var(--space-4); }
.hero h1 {
  font-size: var(--step-4);
  line-height: 1.02;
  letter-spacing: -0.03em;
  max-width: 16ch;
}
.hero h1 em { font-style: italic; color: var(--ink-muted); }
.eyebrow {
  font-size: 0.75rem; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--ink-faint); margin-bottom: var(--space-2);
}
.hero p.lede {
  font-size: var(--step-2); line-height: 1.45; color: var(--ink-muted);
  max-width: 44ch; font-family: var(--font-display);
}
.hero-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }

/* ---------- Sections ---------- */

.section { padding: var(--space-6) 0; }
@media (max-width: 620px) {
  /* A phone screen cannot spare 96px of air above every heading. */
  .section, .band { padding: var(--space-5) 0; }
  .hero { padding: var(--space-4) 0 var(--space-4); }
}
.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: var(--space-3); flex-wrap: wrap;
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--hairline);
}
.section-head h2 { font-size: var(--step-3); }
.section-head .meta { font-size: 0.875rem; color: var(--ink-faint); }

/* ---------- Works grid ---------- */

/* Even rows, nothing cropped: each painting sits centred on a mat, the way it
   would hang on a wall, so mixed portrait and landscape formats still line up. */
.works {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: clamp(28px, 3.4vw, 56px) clamp(16px, 2.4vw, 36px);
}
.work { display: flex; flex-direction: column; gap: 14px; }
.work-figure {
  position: relative; margin: 0;
  height: clamp(280px, 26vw, 400px);
  display: grid; place-items: center;
  padding: clamp(14px, 1.6vw, 26px);
  background: var(--bg-sunken);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: zoom-in;
  border: 0; width: 100%;
  transition: background 0.4s var(--ease);
}
.work-figure::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  border-radius: inherit; box-shadow: inset 0 0 0 1px var(--hairline);
}
.work-figure img {
  max-height: 100%; max-width: 100%; width: auto; height: auto;
  object-fit: contain;
  box-shadow: var(--shadow-soft);
  transition: transform 0.6s var(--ease), box-shadow 0.6s var(--ease);
}
.work-figure:hover img { transform: scale(1.035); box-shadow: var(--shadow-lift); }
.work-meta { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-2); }
.work-title { font-family: var(--font-display); font-size: 1.0625rem; }
.work-title .year { color: var(--ink-faint); font-family: var(--font-ui); font-size: 0.8125rem; margin-left: 8px; }
.work-sub { font-size: 0.8125rem; color: var(--ink-muted); }
.tag {
  font-size: 0.6875rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-faint); border: 1px solid var(--hairline);
  padding: 2px 8px; border-radius: 980px; white-space: nowrap;
}
.tag[data-status="sold"] { color: var(--ink-faint); }
.tag[data-status="available"] { color: var(--accent); border-color: var(--accent-soft); background: var(--accent-soft); }

/* ---------- Feature band (Picplacer) ---------- */

.band {
  background: var(--bg-elevated);
  border-block: 1px solid var(--hairline);
  padding: var(--space-6) 0;
}
.band-grid {
  display: grid; gap: clamp(28px, 5vw, 72px);
  grid-template-columns: 1fr;
  align-items: center;
}
@media (min-width: 900px) { .band-grid { grid-template-columns: 1fr 1.15fr; } }
.band h2 { font-size: var(--step-3); margin-bottom: var(--space-2); }
.band p { color: var(--ink-muted); max-width: 46ch; }
.steps { list-style: none; margin: var(--space-3) 0 var(--space-4); padding: 0; display: grid; gap: 14px; }
.steps li { display: flex; gap: 14px; align-items: flex-start; font-size: 0.9375rem; color: var(--ink-muted); }
.steps .num {
  flex: 0 0 auto; width: 26px; height: 26px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center; font-size: 0.75rem; font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.room-demo {
  position: relative; border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow-lift); background: var(--bg-sunken);
  aspect-ratio: 4 / 3;
}
.room-demo svg { width: 100%; height: 100%; }

/* ---------- About ---------- */

.about-grid { display: grid; gap: clamp(28px, 5vw, 64px); grid-template-columns: 1fr; }
@media (min-width: 860px) { .about-grid { grid-template-columns: 0.8fr 1.2fr; } }
.portrait { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-soft); background: var(--bg-sunken); }
.about-body { max-width: var(--measure); font-size: var(--step-1); color: var(--ink-muted); }
.about-body p:first-child { color: var(--ink); font-family: var(--font-display); font-size: var(--step-2); line-height: 1.4; }

/* ---------- Contact ---------- */

.contact { display: grid; gap: clamp(28px, 5vw, 64px); grid-template-columns: 1fr; }
@media (min-width: 860px) { .contact { grid-template-columns: 1fr 1fr; } }
.field { display: grid; gap: 6px; margin-bottom: var(--space-3); }
.field label { font-size: 0.8125rem; color: var(--ink-muted); }
.field input, .field textarea, .field select {
  font: inherit; color: var(--ink);
  background: var(--bg-elevated);
  border: 1px solid var(--hairline);
  border-radius: 12px; padding: 12px 14px; width: 100%;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.field textarea { min-height: 132px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.form-note { font-size: 0.8125rem; color: var(--ink-faint); }

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--hairline);
  padding: var(--space-5) 0 calc(var(--space-4) + env(safe-area-inset-bottom));
  color: var(--ink-muted); font-size: 0.875rem;
}
.footer-grid { display: flex; flex-wrap: wrap; gap: var(--space-3) var(--space-5); justify-content: space-between; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--ink); }
.footer-links { display: flex; gap: var(--space-3); flex-wrap: wrap; }

/* ---------- Lightbox ---------- */

dialog.lightbox {
  border: 0; padding: 0; background: transparent;
  max-width: min(1200px, 94vw); max-height: 94vh;
  color: var(--ink);
}
dialog.lightbox::backdrop { background: rgba(8, 8, 10, 0.86); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.lightbox-inner {
  background: var(--bg-elevated); border-radius: var(--radius-lg); overflow: hidden;
  display: grid; grid-template-columns: 1fr; box-shadow: var(--shadow-lift);
  max-height: 94vh;
}
@media (min-width: 880px) { .lightbox-inner { grid-template-columns: 1.5fr 0.85fr; } }
.lightbox-image { background: var(--bg-sunken); display: grid; place-items: center; padding: clamp(16px, 3vw, 40px); min-height: 0; }
.lightbox-image img { max-height: min(74vh, 900px); width: auto; object-fit: contain; border-radius: 6px; box-shadow: var(--shadow-soft); }
.lightbox-info { padding: clamp(20px, 3vw, 36px); display: flex; flex-direction: column; gap: var(--space-2); overflow-y: auto; }
.lightbox-info h3 { font-size: var(--step-2); }
.lightbox-info dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 18px; font-size: 0.875rem; }
.lightbox-info dt { color: var(--ink-faint); }
.lightbox-info dd { margin: 0; }
.lightbox-actions { margin-top: auto; display: flex; gap: 10px; flex-wrap: wrap; padding-top: var(--space-2); }
.lightbox-close {
  position: absolute; top: 14px; right: 14px; z-index: 2;
  width: 36px; height: 36px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--bg-elevated);
  background: color-mix(in srgb, var(--bg-elevated) 80%, transparent);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  color: var(--ink); font-size: 17px; line-height: 1;
  box-shadow: var(--shadow-soft);
}
.lightbox-shell { position: relative; }

/* ---------- Reveal on scroll ---------- */

.reveal { opacity: 0; transform: translateY(18px); }
.reveal.is-visible { opacity: 1; transform: none; transition: opacity 0.5s var(--ease), transform 0.5s var(--ease); }
@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal.is-visible { opacity: 1; transform: none; transition: none; }
  .work-figure img, .work-figure { transition: none; }
}
