/* ==========================================================================
   Atelier Rumah. Interior design studio.
   Tokens, base, sections. Admin styles live in admin.css.
   ========================================================================== */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/inter-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/inter-500-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/inter-600-normal.woff2") format("woff2");
}

:root {
  --stone: #f4f2ee;
  --stone-2: #e8e4dc;
  --surface: #fbfaf8;
  --ink: #1a1815;
  --ink-2: #413c35;
  --muted: #6b6559;
  --line: #ddd7cc;
  --clay: #8c5b3f;
  --clay-deep: #71462f;
  --dark: #1a1815;
  --on-dark: #efece5;
  --on-dark-muted: #a09884;

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;

  --fs-display: clamp(2.25rem, 1.4rem + 4.2vw, 4.75rem);
  --fs-h2: clamp(1.625rem, 1.2rem + 2vw, 2.75rem);
  --fs-h3: clamp(1.125rem, 1rem + 0.6vw, 1.4rem);
  --fs-lead: clamp(1rem, 0.95rem + 0.4vw, 1.1875rem);
  --fs-body: clamp(0.9375rem, 0.9rem + 0.18vw, 1.0625rem);
  --fs-small: 0.875rem;
  --fs-label: 0.6875rem;

  --tracking-label: 0.18em;
  --tracking-tight: -0.012em;

  --gutter: clamp(1.25rem, 0.9rem + 1.8vw, 3rem);
  --section-y: clamp(4rem, 2.5rem + 6vw, 8rem);
  --container: 84rem;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --dur: 300ms;
  --dur-slow: 800ms;
  --bar-h: 4.5rem;
  --radius: 2px;
}

/* Base --------------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  background: var(--stone);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }
button, input, textarea, select { font: inherit; color: inherit; }
ul { list-style: none; padding: 0; }
a { color: inherit; }

h1, h2, h3 {
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: var(--tracking-tight);
  text-wrap: balance;
}

p { text-wrap: pretty; }

:focus-visible { outline: 2px solid var(--clay); outline-offset: 3px; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip {
  position: absolute;
  left: 1rem; top: 1rem;
  z-index: 200;
  padding: 0.75rem 1rem;
  background: var(--ink);
  color: var(--stone);
  text-decoration: none;
  font-size: var(--fs-small);
  transform: translateY(-150%);
  transition: transform var(--dur) var(--ease);
}
.skip:focus-visible { transform: translateY(0); }

.wrap {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.label {
  font-size: var(--fs-label);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}

.section { padding-block: var(--section-y); }

.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity var(--dur-slow) var(--ease), transform var(--dur-slow) var(--ease);
  transition-delay: var(--d, 0ms);
}
.js .reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .js .reveal { opacity: 1; transform: none; }
}

/* Buttons ------------------------------------------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 3rem;
  padding: 0.85rem 1.6rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: var(--fs-small);
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease),
    border-color var(--dur) var(--ease), opacity var(--dur) var(--ease);
}

.btn--solid { background: var(--ink); color: var(--stone); }
.btn--solid:hover { background: var(--clay); }
.btn--line { border-color: var(--line); color: var(--ink); background: var(--surface); }
.btn--line:hover { border-color: var(--ink); }
.btn--light { background: var(--on-dark); color: var(--dark); }
.btn--light:hover { background: #fff; }
.btn[disabled] { opacity: 0.55; cursor: progress; }

/* Header ------------------------------------------------------------------- */

.bar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  height: var(--bar-h);
  display: flex;
  align-items: center;
  color: var(--on-dark);
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease);
}

.bar.stuck {
  background: rgba(244, 242, 238, 0.92);
  backdrop-filter: blur(10px);
  color: var(--ink);
  box-shadow: 0 1px 0 var(--line);
}

.bar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
}

.brand {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  font-size: var(--fs-label);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  font-weight: 600;
  text-decoration: none;
}

.bar__nav { display: none; }
@media (min-width: 60rem) { .bar__nav { display: flex; align-items: center; gap: 2.25rem; } }

.bar__link {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  font-size: var(--fs-label);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  text-decoration: none;
  opacity: 0.85;
  transition: opacity var(--dur) var(--ease);
}
.bar__link:hover { opacity: 1; }

.bar__cta { display: none; }
@media (min-width: 60rem) { .bar__cta { display: inline-flex; } }

.bar.stuck .bar__cta { background: var(--ink); color: var(--stone); }
.bar:not(.stuck) .bar__cta { background: var(--on-dark); color: var(--dark); }

.burger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem; height: 2.75rem;
  margin-right: -0.5rem;
  background: none; border: 0; cursor: pointer;
  color: inherit;
}
@media (min-width: 60rem) { .burger { display: none; } }

.burger__bars { position: relative; width: 22px; height: 11px; }
.burger__bars span {
  position: absolute; left: 0;
  width: 100%; height: 1.5px;
  background: currentColor;
  transition: transform var(--dur) var(--ease);
}
.burger__bars span:nth-child(1) { top: 0; }
.burger__bars span:nth-child(2) { bottom: 0; }
.burger[aria-expanded="true"] .burger__bars span:nth-child(1) { transform: translateY(4.75px) rotate(45deg); }
.burger[aria-expanded="true"] .burger__bars span:nth-child(2) { transform: translateY(-4.75px) rotate(-45deg); }

.drawer {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1.5rem;
  padding: var(--bar-h) var(--gutter) calc(2rem + env(safe-area-inset-bottom));
  background: var(--stone);
  color: var(--ink);
  visibility: hidden;
  opacity: 0;
  transition: opacity var(--dur) var(--ease), visibility var(--dur) var(--ease);
}
.drawer.open { visibility: visible; opacity: 1; }
@media (min-width: 60rem) { .drawer { display: none; } }

.drawer__link {
  display: block;
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
  font-size: clamp(1.5rem, 7vw, 2.25rem);
  font-weight: 500;
  text-decoration: none;
}

/* Hero --------------------------------------------------------------------- */

.hero { position: relative; min-height: 82svh; display: flex; align-items: flex-end; }

.hero__img { position: absolute; inset: 0; }
.hero__img img { width: 100%; height: 100%; object-fit: cover; }
.hero__img::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(26, 24, 21, 0.85) 0%,
    rgba(26, 24, 21, 0.22) 52%,
    rgba(26, 24, 21, 0.55) 100%
  );
}

.hero__content {
  position: relative;
  width: 100%;
  padding-block: clamp(2.5rem, 1.5rem + 5vw, 5rem);
  color: var(--on-dark);
}

.hero__grid { display: grid; gap: 1.5rem; }

@media (min-width: 60rem) {
  .hero__grid { grid-template-columns: 1.4fr 1fr; align-items: end; gap: 3rem; }
}

.hero__title { font-size: var(--fs-display); max-width: 16ch; margin-top: 1rem; }
.hero__note { color: rgba(239, 236, 229, 0.82); max-width: 34ch; }
.hero .label { color: rgba(239, 236, 229, 0.7); }

.hero__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.75rem; }
@media (max-width: 26rem) { .hero__actions .btn { flex: 1 1 100%; } }

/* Intro -------------------------------------------------------------------- */

.intro { display: grid; gap: 2rem; }
@media (min-width: 60rem) { .intro { grid-template-columns: 1fr 1.2fr; gap: 4rem; } }
.intro__text { font-size: var(--fs-lead); color: var(--ink-2); max-width: 54ch; }
.intro__text + .intro__text { margin-top: 1rem; }

/* Projects ----------------------------------------------------------------- */

.head { display: flex; flex-direction: column; gap: 1rem; margin-bottom: 2.5rem; }
@media (min-width: 48rem) {
  .head { flex-direction: row; align-items: end; justify-content: space-between; }
}
.head__title { font-size: var(--fs-h2); max-width: 18ch; }
.head__note { color: var(--muted); max-width: 34ch; font-size: var(--fs-small); }

.projects { display: grid; gap: clamp(2rem, 1rem + 3vw, 3.5rem); }
@media (min-width: 56rem) { .projects { grid-template-columns: repeat(2, 1fr); } }

.project__media {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--stone-2);
  border-radius: var(--radius);
}
.project__media img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform var(--dur-slow) var(--ease);
}
@media (hover: hover) { .project:hover .project__media img { transform: scale(1.035); } }

/* First card runs wide on large screens for an editorial rhythm. */
@media (min-width: 56rem) {
  .project:first-child { grid-column: 1 / -1; }
  .project:first-child .project__media { aspect-ratio: 21 / 9; }
}

.project__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 1rem;
  margin-top: 1rem;
}
.project__name { font-size: var(--fs-h3); }
.project__where { font-size: var(--fs-small); color: var(--muted); }
.project__scope { margin-top: 0.35rem; font-size: var(--fs-small); color: var(--muted); }

/* Services ----------------------------------------------------------------- */

.services { background: var(--stone-2); }
.svc-list { border-top: 1px solid var(--line); }

.svc {
  display: grid;
  gap: 0.35rem 2rem;
  padding-block: clamp(1.25rem, 1rem + 1.2vw, 2rem);
  border-bottom: 1px solid var(--line);
}
@media (min-width: 48rem) { .svc { grid-template-columns: 3rem 1fr 1.2fr; align-items: baseline; } }

.svc__num { font-size: var(--fs-label); letter-spacing: 0.1em; color: var(--clay); }
.svc__name { font-size: var(--fs-h3); }
.svc__text { color: var(--muted); max-width: 48ch; }

/* Process ------------------------------------------------------------------ */

.steps { display: grid; gap: 1.5rem; margin-top: 2rem; }
@media (min-width: 48rem) { .steps { grid-template-columns: repeat(4, 1fr); gap: 2rem; } }
.step { border-top: 1px solid var(--line); padding-top: 1rem; }
.step__num { font-size: var(--fs-label); letter-spacing: 0.1em; color: var(--clay); }
.step__title { font-size: var(--fs-h3); margin-block: 0.4rem; }
.step__text { color: var(--muted); font-size: var(--fs-small); }

/* Studio ------------------------------------------------------------------- */

.studio { display: grid; gap: 2.5rem; }
@media (min-width: 60rem) { .studio { grid-template-columns: 0.9fr 1.1fr; gap: 4rem; align-items: center; } }
.studio__media { aspect-ratio: 4 / 5; overflow: hidden; border-radius: var(--radius); background: var(--stone-2); }
.studio__media img { width: 100%; height: 100%; object-fit: cover; }
.studio__title { font-size: var(--fs-h2); margin-block: 1rem; max-width: 16ch; }
.studio__text { color: var(--ink-2); max-width: 50ch; }
.studio__text + .studio__text { margin-top: 1rem; }

.detail-row { display: grid; gap: 1rem; margin-top: 2rem; }
@media (min-width: 34rem) { .detail-row { grid-template-columns: 1fr 1fr; } }
.detail-row figure { aspect-ratio: 4 / 5; overflow: hidden; border-radius: var(--radius); }
.detail-row img { width: 100%; height: 100%; object-fit: cover; }

/* Consultation form -------------------------------------------------------- */

.consult { background: var(--dark); color: var(--on-dark); }
.consult .label { color: var(--on-dark-muted); }
.consult__grid { display: grid; gap: 2.5rem; }
@media (min-width: 60rem) { .consult__grid { grid-template-columns: 0.85fr 1.15fr; gap: 4rem; align-items: start; } }

.consult__title { font-size: var(--fs-h2); margin-block: 1rem; max-width: 14ch; }
.consult__text { color: var(--on-dark-muted); max-width: 42ch; }
.consult__aside { margin-top: 2rem; font-size: var(--fs-small); color: var(--on-dark-muted); }
.consult__aside strong { display: block; color: var(--on-dark); font-weight: 500; }
.consult__aside p + p { margin-top: 1rem; }

.form-grid { display: grid; gap: 1.25rem; }
@media (min-width: 34rem) { .form-grid--two { grid-template-columns: 1fr 1fr; } }

.field { display: flex; flex-direction: column; gap: 0.4rem; }

.field > span {
  font-size: var(--fs-label);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--on-dark-muted);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 0.8rem 0.9rem;
  background: transparent;
  border: 1px solid rgba(239, 236, 229, 0.24);
  border-radius: var(--radius);
  color: var(--on-dark);
  font-size: 1rem;
  resize: vertical;
}

.field select { appearance: none; background-image: none; }
.field select option { background: var(--dark); color: var(--on-dark); }
.field input::placeholder, .field textarea::placeholder { color: rgba(160, 152, 132, 0.75); }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--on-dark); }
.field[data-invalid="true"] input,
.field[data-invalid="true"] select,
.field[data-invalid="true"] textarea { border-color: #d98d6a; }

.field__error { font-size: 0.8125rem; color: #e0a184; min-height: 1rem; }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form__submit { margin-top: 1.5rem; width: 100%; }
@media (min-width: 34rem) { .form__submit { width: auto; min-width: 15rem; } }

.form__status { margin-top: 1rem; font-size: var(--fs-small); min-height: 1.5rem; }
.form__status[data-tone="error"] { color: #e0a184; }
.form__status[data-tone="ok"] { color: #a8c68f; }

.form__done {
  padding: 2rem;
  border: 1px solid rgba(239, 236, 229, 0.24);
  border-radius: var(--radius);
}
.form__done h3 { font-size: var(--fs-h3); margin-bottom: 0.5rem; }
.form__done p { color: var(--on-dark-muted); }

/* Footer ------------------------------------------------------------------- */

.foot { padding-block: 3rem calc(3rem + env(safe-area-inset-bottom)); }
.foot__inner {
  display: flex; flex-wrap: wrap;
  gap: 1rem 2rem;
  align-items: center; justify-content: space-between;
  font-size: var(--fs-small); color: var(--muted);
}
.foot__note { max-width: 48ch; }
.foot a { text-decoration: none; }
.foot a:hover { color: var(--ink); }

/* ==========================================================================
   Mobile composition. Architecture photography runs to the edges, meta becomes
   ruled rows, and a consultation bar stays in reach.
   ========================================================================== */

@media (max-width: 47.99rem) {
  .hero { min-height: 88svh; }
  .hero__title { max-width: 12ch; }
  .hero__note {
    max-width: none;
    padding-top: 1rem;
    border-top: 1px solid rgba(239, 236, 229, 0.28);
  }
  .hero__grid { gap: 1.25rem; }

  .head { gap: 0.75rem; }
  .head__note {
    max-width: none;
    padding-top: 1rem;
    border-top: 1px solid var(--line);
  }

  /* Project photography runs edge to edge and stands taller. */
  .projects { gap: 3rem; }

  .project__media {
    margin-inline: calc(var(--gutter) * -1);
    width: calc(100% + var(--gutter) * 2);
    border-radius: 0;
    aspect-ratio: 4 / 5;
  }

  .project__meta {
    justify-content: space-between;
    padding-block: 0.85rem 0;
    border-top: 1px solid var(--line);
    margin-top: 1rem;
  }

  .project__where { text-align: right; }

  /* Services read as a numbered list rather than three stacked blocks. */
  .svc { grid-template-columns: 2.25rem 1fr; column-gap: 0.5rem; }
  .svc__name { grid-column: 2; }
  .svc__text { grid-column: 2; max-width: none; }

  .steps { gap: 0; }
  .step { padding-block: 1.15rem; }

  .studio__media { aspect-ratio: 3 / 4; }
  .studio__text { max-width: none; }

  .consult__aside strong { margin-bottom: 0.15rem; }

  /* Room for the consultation bar. */
  body { padding-bottom: 4.75rem; }
}

/* Sticky consultation bar, mobile only. Tucks away over the form itself. */
.actionbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 85;
  display: none;
  gap: 0.75rem;
  align-items: center;
  padding: 0.75rem var(--gutter) calc(0.75rem + env(safe-area-inset-bottom));
  background: rgba(244, 242, 238, 0.95);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
  transition: transform var(--dur) var(--ease), opacity var(--dur) var(--ease);
}

@media (max-width: 47.99rem) { .actionbar { display: flex; } }

.actionbar.tucked {
  transform: translateY(110%);
  opacity: 0;
  pointer-events: none;
}

.actionbar__text { flex: 1; font-size: 0.8125rem; line-height: 1.35; color: var(--muted); }
.actionbar__text strong { display: block; color: var(--ink); font-weight: 500; }
.actionbar .btn { min-height: 2.75rem; padding-inline: 1.15rem; white-space: nowrap; }

/* The hidden attribute has to beat the display rules declared above. */
[hidden] { display: none !important; }
