/* ==========================================================
   Lexiconic Interiors - site styles
   Edit colors and fonts here (the :root block) and every page updates.
   ========================================================== */

:root {
  --bg: #f5f5f3;
  --ink: #000;
  --muted: #6b6b6b;
  --line: #000;
  --rule: #cfcfcf; /* thin gray divider lines (header, footer, project sections) */
  --serif: "Lora", Georgia, "Times New Roman", serif;
  --sans: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --page-max: 1280px;
  --gutter: clamp(1.25rem, 3.5vw, 2.5rem);
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.6;
}

main {
  flex: 1;
}

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

h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 700;
  line-height: 1.2;
  margin: 0;
}

p {
  margin: 0 0 1em;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 20;
  padding: 0.6rem 1rem;
  background: var(--ink);
  color: var(--bg);
}

.skip-link:focus {
  top: 1rem;
}

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

.site-header {
  position: relative;
  z-index: 10;
  background: var(--bg);
}

.site-header.is-ruled {
  border-bottom: 1px solid var(--rule);
}

.header-inner {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 1.5rem var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem 2rem;
}

.logo img {
  display: block;
  position: relative;
  top: -2px; /* nudged up so the logo looks centered in the header */
  width: clamp(140px, 15vw, 196px);
  height: auto;
}

.header-right {
  display: flex;
  align-items: center;
  gap: clamp(1.25rem, 4vw, 3.5rem);
}

.site-header nav ul {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem clamp(1.25rem, 4vw, 3.5rem);
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-header nav a {
  display: inline-block;
  padding: 0.25rem 0;
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.site-header nav a:hover {
  border-bottom-color: var(--ink);
}

.site-header .insta-link {
  display: block;
  flex: 0 0 auto;
}

.site-header .insta-link img {
  display: block;
  width: 24px;
  height: 24px;
}

/* Menu button: only shown on phones */
.menu-toggle {
  display: none;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}

.menu-toggle svg {
  display: block;
}

.menu-toggle .icon-close,
.menu-toggle[aria-expanded="true"] .icon-open {
  display: none;
}

.menu-toggle[aria-expanded="true"] .icon-close {
  display: block;
}

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

.site-footer {
  border-top: 1px solid var(--rule);
  padding: 2.25rem 1.5rem;
  text-align: center;
  font-size: 0.8rem;
}

.site-footer p {
  margin: 0;
}

/* ---------- Home ---------- */

.hero {
  display: block;
  width: 100%;
  aspect-ratio: 814 / 551;
  max-height: min(75vh, 720px);
  object-fit: cover;
}

.intro {
  /* The stars scale with the heading, so they stay in proportion at every screen size */
  --intro-heading: clamp(1.6rem, 3vw, 2rem);
  max-width: 780px;
  margin: 0 auto;
  padding: 3.5rem 1.5rem 3rem;
  text-align: center;
}

.intro-stars {
  display: block;
  width: auto;
  height: calc(var(--intro-heading) * 1.5);
  margin: 0 auto calc(var(--intro-heading) * 0.45);
}

.intro h1 {
  font-size: var(--intro-heading);
  margin-bottom: 1.5rem;
}

.intro p {
  margin: 0;
}

.tiles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 0 1.25rem;
  list-style: none;
}

.tiles img {
  display: block;
  width: 100%;
  aspect-ratio: 244 / 193;
  object-fit: cover;
}

.testimonial {
  max-width: 1100px;
  margin: 4rem auto;
  padding: 0 1.5rem;
}

.testimonial figure {
  margin: 0;
  padding: clamp(1.75rem, 5vw, 3rem) clamp(1.25rem, 9vw, 6.5rem);
  border: 1px solid var(--line);
  text-align: center;
}

.testimonial blockquote {
  max-width: 42em;
  margin: 0 auto;
  font-family: var(--serif);
  font-size: 1.05rem;
  line-height: 1.5;
}

.testimonial blockquote p {
  margin: 0;
}

.testimonial figcaption {
  margin-top: 2rem;
  font-family: var(--serif);
  font-size: 0.8rem;
}

/* ---------- Our Story ---------- */

.quote-band {
  border-bottom: 1px solid var(--rule);
  padding: 3.25rem 1.5rem;
  text-align: center;
}

.quote-band figure {
  margin: 0;
}

.quote-band blockquote {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.35rem, 2.6vw, 1.7rem);
  line-height: 1.3;
}

.quote-band blockquote p {
  margin: 0;
}

.quote-band figcaption {
  margin-top: 0.35rem;
  font-family: var(--serif);
  font-size: 0.95rem;
  color: var(--muted);
}

.story {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 2rem var(--gutter) 3.5rem;
}

.story h1 {
  font-size: clamp(2rem, 4.5vw, 2.75rem);
  margin-bottom: 3rem;
}

.person {
  display: grid;
  grid-template-columns: minmax(0, 350px) minmax(0, 1fr);
  gap: 2rem;
  align-items: start;
  margin-bottom: 4.5rem;
}

.person:last-child {
  margin-bottom: 0;
}

.person img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.person h2 {
  font-size: clamp(1.6rem, 3vw, 2rem);
  margin-bottom: 1rem;
}

.person p {
  max-width: 62ch;
}

/* ---------- Featured Projects ---------- */

.project {
  border-top: 1px solid var(--rule);
  padding: 1.5rem 0 1.75rem;
}

/* The header already draws a line right above the first project,
   so skip this one to avoid a doubled (thicker) line. */
.project:first-of-type {
  border-top: 0;
}

.project-inner {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.project h2 {
  font-size: clamp(1.4rem, 2.6vw, 1.7rem);
  margin-bottom: 50px;
}

.project h2 .version {
  font-size: 0.8em;
  font-weight: 500;
  color: var(--muted);
}

.project p {
  max-width: 120ch;
  margin: 1rem 0 0;
  font-size: 0.95rem;
}

.project p.project-link {
  margin-top: 0.6rem;
}

.project-link a {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.project-link a:hover {
  text-decoration-thickness: 2px;
}

.project .coming-soon {
  margin: 0 0 0.25rem;
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 700;
  color: var(--muted);
}

.carousel {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.carousel-track {
  flex: 1;
  min-width: 0;
  display: flex;
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.carousel-track::-webkit-scrollbar {
  display: none;
}

.carousel-track li {
  flex: 0 0 calc((100% - 1.5rem) / 3);
  scroll-snap-align: start;
}

.carousel-track img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 15;
  object-fit: cover;
}

.carousel-btn {
  flex: 0 0 2.25rem;
  width: 2.25rem;
  height: 2.25rem;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  visibility: hidden;
}

.carousel-btn.is-visible {
  visibility: visible;
}

/* Left arrow: same chevron as the right arrow, on a page-colored circle so it
   stays readable over the photos. z-index keeps it above the clickable photos. */
.carousel-btn.prev {
  position: absolute;
  left: 0.5rem;
  top: 50%;
  z-index: 2;
  transform: translateY(-50%);
  border-radius: 50%;
  background: var(--bg);
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.28);
}

/* ---------- Clickable project photos + popup ---------- */

.carousel-track a {
  position: relative;
  display: block;
  cursor: zoom-in;
}

.carousel-track a:focus-visible {
  outline: none;
}

/* Two-tone ring (white + black) so keyboard focus shows on any photo */
.carousel-track a:focus-visible::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 3px solid #fff;
  box-shadow: inset 0 0 0 2px #000;
  pointer-events: none;
}

html.lightbox-open {
  overflow: hidden;
}

.lightbox {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #fff;
}

.lightbox[open] {
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox::backdrop {
  background: rgba(0, 0, 0, 0.88);
}

.lightbox img {
  display: block;
  width: auto;
  height: auto;
  max-width: min(94vw, 1600px);
  max-height: 88vh;
  object-fit: contain;
}

.lightbox img.is-loading {
  opacity: 0;
}

.lightbox-close {
  position: absolute;
  top: max(1rem, env(safe-area-inset-top));
  right: max(1rem, env(safe-area-inset-right));
  width: 2.75rem;
  height: 2.75rem;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  cursor: pointer;
}

.lightbox-close:hover {
  background: #000;
}

.lightbox-close:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

@media (prefers-reduced-motion: no-preference) {
  .lightbox img {
    transition: opacity 0.15s ease;
  }
}

/* ---------- Two-column pages (Contact, Services) ---------- */

/* On tall windows the footer stays at the bottom, so the leftover space is
   split above and below the content instead of all landing under it. */
main:has(> .split) {
  display: flex;
  flex-direction: column;
}

main:has(> .split) > .split {
  width: 100%;
  margin-block: auto;
}

.split {
  display: grid;
  gap: clamp(1.5rem, 3vw, 2.5rem);
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 1.5rem 1.25rem 2.5rem;
}

.split.contact {
  grid-template-columns: minmax(0, 4fr) minmax(0, 6.5fr);
}

.split.services {
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
}

.split figure {
  margin: 0;
}

.split.contact figure {
  min-height: 420px;
}

.split.contact figure img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.split.services figure img {
  display: block;
  width: 100%;
}

.split h1 {
  font-size: clamp(1.6rem, 3vw, 2rem);
  margin-bottom: 0.75rem;
}

.split .lede {
  margin-bottom: 2.25rem;
}

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

.field {
  margin-bottom: 1.25rem;
}

.field label {
  display: block;
  margin-bottom: 0.4rem;
  color: var(--muted);
}

.field input,
.field textarea {
  display: block;
  width: 100%;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
}

.field input {
  height: 2.9rem;
}

.field textarea {
  min-height: 18rem;
  resize: vertical;
}

.button {
  min-width: 9rem;
  height: 2.9rem;
  padding: 0 1.5rem;
  border: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
}

.button:hover {
  background: var(--ink);
  color: var(--bg);
}

.form-status {
  margin: 1rem 0 0;
  font-size: 0.9rem;
}

.form-status.is-error {
  color: #9b1c1c;
}

.form-status a {
  color: inherit;
}

.button[disabled] {
  opacity: 0.6;
  cursor: default;
}

.button[disabled]:hover {
  background: transparent;
  color: var(--ink);
}

/* Hidden spam trap: real visitors never see or fill this in */
.hp {
  display: none;
}

/* ---------- Small screens ---------- */

@media (max-width: 760px) {
  /* Logo on the left; Instagram + menu button on the right.
     The links live in a dropdown that the menu button opens. */
  .header-inner {
    flex-wrap: nowrap;
    gap: 0.75rem;
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
  }

  .logo {
    flex: 0 0 auto;
  }

  .logo img {
    width: clamp(106px, 30vw, 146px);
  }

  .header-right {
    gap: 0;
    margin-left: auto;
  }

  .site-header .insta-link {
    padding: 0.6rem;
  }

  .menu-toggle {
    display: grid;
    margin-right: -0.5rem;
  }

  .site-header nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg);
    border-top: 1px solid var(--rule);
    border-bottom: 1px solid var(--rule);
    box-shadow: 0 14px 24px -14px rgba(0, 0, 0, 0.2);
  }

  .site-header.menu-open nav {
    display: block;
  }

  .site-header nav ul {
    flex-direction: column;
    align-items: stretch;
    flex-wrap: nowrap;
    gap: 0;
  }

  .site-header nav li + li {
    border-top: 1px solid var(--rule);
  }

  .site-header nav a {
    display: block;
    padding: 1rem var(--gutter);
    font-size: 1rem;
    border-bottom: 0;
  }

  .site-header nav a[aria-current="page"] {
    font-weight: 600;
  }

  .tiles {
    grid-template-columns: 1fr;
  }

  .person {
    grid-template-columns: 1fr;
    gap: 1.25rem;
    margin-bottom: 3rem;
  }

  .person img {
    max-width: 420px;
  }

  .carousel-track li {
    flex-basis: 70%;
  }

  .split.contact,
  .split.services {
    grid-template-columns: 1fr;
  }

  /* Show the whole Contact photo (it is a tall portrait), not a cropped band */
  .split.contact figure {
    min-height: 0;
    max-width: 440px;
    margin: 0 auto;
  }

  .split.contact figure img {
    height: auto;
  }

  .split.services figure {
    max-width: 480px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .carousel-track {
    scroll-behavior: auto;
  }
}
