/* Pactoriva — single landing page.
   Both themes are defined as token sets on :root so the toggle only ever
   flips one attribute; nothing downstream needs to know which theme is on. */

:root {
  /* light is the default; dark overrides below */
  --bg: #faf8f5;
  --bg-2: #f2eee8;
  --surface: #ffffff;
  --line: rgba(24, 20, 16, 0.12);
  --line-soft: rgba(24, 20, 16, 0.07);
  --text: #1a1714;
  --text-2: rgba(26, 23, 20, 0.72);
  --text-3: rgba(26, 23, 20, 0.52);
  --accent: #9a6b34;
  --accent-soft: rgba(154, 107, 52, 0.12);
  --on-accent: #fffaf3;
  --shadow: 0 1px 2px rgba(24, 20, 16, 0.05), 0 12px 32px -18px rgba(24, 20, 16, 0.3);

  --shell: 72rem;
  --pad: clamp(1.25rem, 4vw, 2.5rem);
  --section-y: clamp(4.5rem, 10vw, 8rem);
  --radius: 14px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  --t-hero: clamp(2.25rem, 6vw, 4.1rem);
  --t-h2: clamp(1.6rem, 3.4vw, 2.5rem);
  --t-h3: 1.1rem;
  --t-body: clamp(1rem, 1.1vw, 1.0625rem);
  --t-small: 0.875rem;
  --t-eyebrow: 0.75rem;

  color-scheme: light;
}

:root[data-theme='dark'] {
  --bg: #0f1115;
  --bg-2: #14171d;
  --surface: #171b22;
  --line: rgba(240, 234, 226, 0.14);
  --line-soft: rgba(240, 234, 226, 0.08);
  --text: #f0eae2;
  --text-2: rgba(240, 234, 226, 0.7);
  --text-3: rgba(240, 234, 226, 0.48);
  --accent: #d9a463;
  --accent-soft: rgba(217, 164, 99, 0.14);
  --on-accent: #14110c;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 18px 40px -22px rgba(0, 0, 0, 0.8);

  color-scheme: dark;
}

/* Follow the operating system until the visitor chooses for themselves. */
@media (prefers-color-scheme: dark) {
  :root[data-theme='auto'] {
    --bg: #0f1115;
    --bg-2: #14171d;
    --surface: #171b22;
    --line: rgba(240, 234, 226, 0.14);
    --line-soft: rgba(240, 234, 226, 0.08);
    --text: #f0eae2;
    --text-2: rgba(240, 234, 226, 0.7);
    --text-3: rgba(240, 234, 226, 0.48);
    --accent: #d9a463;
    --accent-soft: rgba(217, 164, 99, 0.14);
    --on-accent: #14110c;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 18px 40px -22px rgba(0, 0, 0, 0.8);

    color-scheme: dark;
  }
}

/* --- base -------------------------------------------------------------- */

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

* {
  margin: 0;
}

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

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: var(--t-body);
  font-weight: 300;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.4s var(--ease), color 0.4s var(--ease);
}

h1,
h2,
h3 {
  font-family: 'Fraunces', ui-serif, Georgia, serif;
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

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

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

/* The width/height attributes on <img> reserve space before the file arrives,
   but they also act as presentational hints. With both set, `aspect-ratio`
   never applies, and the image renders at its full intrinsic height. Letting
   height resolve automatically hands the ratio back to CSS. */
img {
  height: auto;
}

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

.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--pad);
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 0.75rem 1.1rem;
  background: var(--accent);
  color: var(--on-accent);
}

.skip:focus {
  left: 0.75rem;
  top: 0.75rem;
}

.eyebrow {
  font-size: var(--t-eyebrow);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--accent);
  margin-bottom: 1.1rem;
}

/* --- header ------------------------------------------------------------ */

.site-head {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.35s var(--ease), background-color 0.4s var(--ease);
}

.site-head.is-stuck {
  border-bottom-color: var(--line-soft);
}

.head-inner {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 4vw, 2.5rem);
  min-height: 4.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  margin-right: auto;
  color: var(--text);
}

.brand__mark {
  width: 30px;
  height: 30px;
  flex: none;
  color: var(--accent);
  transition: transform 0.5s var(--ease);
}

.brand:hover .brand__mark {
  transform: rotate(-6deg) scale(1.04);
}

.brand__word {
  font-family: 'Fraunces', ui-serif, Georgia, serif;
  font-size: 1.22rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.head-nav {
  display: flex;
  gap: clamp(1rem, 2.6vw, 2rem);
  font-size: var(--t-small);
  color: var(--text-2);
}

.head-nav a {
  position: relative;
  padding-block: 0.25rem;
  transition: color 0.3s var(--ease);
}

.head-nav a::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s var(--ease);
}

.head-nav a:hover {
  color: var(--text);
}

.head-nav a:hover::after {
  transform: scaleX(1);
}

@media (max-width: 40rem) {
  .head-nav {
    display: none;
  }
}

.theme-toggle {
  display: grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  flex: none;
  padding: 0;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--text-2);
  cursor: pointer;
  transition: border-color 0.3s var(--ease), color 0.3s var(--ease),
    background-color 0.3s var(--ease);
}

.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.theme-toggle svg {
  width: 17px;
  height: 17px;
  grid-area: 1 / 1;
  transition: opacity 0.3s var(--ease), transform 0.45s var(--ease);
}

/* Show the icon for the theme the click would switch TO. */
.theme-toggle__sun {
  opacity: 0;
  transform: rotate(-70deg) scale(0.6);
}

.theme-toggle__moon {
  opacity: 1;
  transform: none;
}

:root[data-theme='dark'] .theme-toggle__sun {
  opacity: 1;
  transform: none;
}

:root[data-theme='dark'] .theme-toggle__moon {
  opacity: 0;
  transform: rotate(70deg) scale(0.6);
}

@media (prefers-color-scheme: dark) {
  :root[data-theme='auto'] .theme-toggle__sun {
    opacity: 1;
    transform: none;
  }

  :root[data-theme='auto'] .theme-toggle__moon {
    opacity: 0;
    transform: rotate(70deg) scale(0.6);
  }
}

/* --- hero -------------------------------------------------------------- */

.hero {
  position: relative;
  isolation: isolate;
  padding-block: clamp(3.5rem, 9vw, 7rem) clamp(3rem, 6vw, 4.5rem);
  overflow: hidden;
}

.hero__wash {
  position: absolute;
  inset: -20% -10% auto;
  height: 130%;
  z-index: -1;
  background:
    radial-gradient(ellipse 48% 42% at 78% 14%, var(--accent-soft), transparent 70%),
    radial-gradient(ellipse 52% 46% at 12% 38%, color-mix(in srgb, var(--accent) 7%, transparent), transparent 72%);
  filter: blur(8px);
  pointer-events: none;
}

.hero__inner {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  gap: clamp(2.5rem, 6vw, 5rem);
  align-items: center;
}

.hero__title {
  font-size: var(--t-hero);
  max-width: 16ch;
}

.hero__title em {
  font-style: italic;
  color: var(--accent);
}

.hero__lede {
  margin-top: clamp(1.4rem, 3vw, 2rem);
  max-width: 58ch;
  font-size: clamp(1.02rem, 1.5vw, 1.2rem);
  color: var(--text-2);
}

.hero__acts {
  margin-top: clamp(2rem, 4vw, 2.75rem);
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem 1.5rem;
  align-items: center;
}

/* The photograph carries the hero's right-hand column. It is a dark image on
   both themes, so it is framed rather than bled: a contained picture reads as
   deliberate on a light page, where a full-bleed dark band would not. */
.hero__shot {
  margin: 0;
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line-soft);
  box-shadow: var(--shadow);
  background: #0b0b0d;
}

.hero__shot img {
  width: 100%;
  aspect-ratio: 5 / 4;
  object-fit: cover;
}

/* A hairline of the brand colour along the top edge ties the photo to the
   rest of the page in light mode, where it otherwise floats. */
.hero__shot::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--accent) 35%, transparent);
  border-radius: inherit;
}

/* The element is also a .shell, so the dividers are drawn as borders on the
   items. A gap-plus-background grid would paint the line colour across the
   shell's own padding and leave a stray strip at each edge. */
.hero__facts {
  margin-top: clamp(2.5rem, 6vw, 4rem);
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  border-block: 1px solid var(--line-soft);
}

.hero__facts li {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 1.35rem clamp(0.9rem, 2vw, 1.5rem);
  border-left: 1px solid var(--line-soft);
}

.hero__facts li:first-child {
  border-left: 0;
  padding-left: 0;
}

.hero__facts strong {
  font-weight: 500;
  font-size: 0.95rem;
}

.hero__facts span {
  font-size: var(--t-small);
  color: var(--text-3);
}

@media (max-width: 58rem) {
  .hero__inner {
    grid-template-columns: minmax(0, 1fr);
    gap: clamp(2rem, 6vw, 3rem);
  }

  .hero__title {
    max-width: 19ch;
  }
}

/* --- buttons ----------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: var(--t-small);
  font-weight: 500;
  letter-spacing: 0.02em;
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: 999px;
  transition: background-color 0.35s var(--ease), color 0.35s var(--ease),
    border-color 0.35s var(--ease), transform 0.35s var(--ease);
  font-family: inherit;
}

.btn__arrow {
  width: 15px;
  height: 1px;
  background: currentColor;
  position: relative;
  transition: width 0.35s var(--ease);
}

.btn__arrow::after {
  content: '';
  position: absolute;
  right: 0;
  top: 50%;
  width: 6px;
  height: 6px;
  border-top: 1px solid currentColor;
  border-right: 1px solid currentColor;
  transform: translateY(-50%) rotate(45deg);
}

.btn:hover .btn__arrow {
  width: 24px;
}

.btn--solid {
  padding: 0.85rem 1.6rem;
  background: var(--accent);
  color: var(--on-accent);
}

.btn--solid:hover {
  transform: translateY(-1px);
  background: color-mix(in srgb, var(--accent) 88%, var(--text));
}

.btn--quiet {
  padding: 0.85rem 0.25rem;
  color: var(--text-2);
}

.btn--quiet:hover {
  color: var(--text);
}

/* --- sections ---------------------------------------------------------- */

.section {
  padding-block: var(--section-y);
}

.section--alt {
  background: var(--bg-2);
  border-block: 1px solid var(--line-soft);
  transition: background-color 0.4s var(--ease);
}

.section__title {
  font-size: var(--t-h2);
  max-width: 20ch;
}

.section__lede {
  margin-top: 1.25rem;
  max-width: 62ch;
  color: var(--text-2);
}

/* --- cards ------------------------------------------------------------- */

/* Two by two: four cards in a three-column grid leave one stranded on a row
   of its own, and four columns squeeze the copy into a ribbon. */
.cards {
  margin-top: clamp(2.5rem, 5vw, 3.75rem);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1rem, 2vw, 1.5rem);
}

@media (max-width: 44rem) {
  .cards {
    grid-template-columns: minmax(0, 1fr);
  }
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.4s var(--ease), transform 0.4s var(--ease),
    box-shadow 0.4s var(--ease), background-color 0.4s var(--ease);
}

.card__body {
  padding: clamp(1.5rem, 2.6vw, 2rem);
}

.card__shot {
  margin: 0;
  position: relative;
  background: #0b0b0d;
  border-bottom: 1px solid var(--line-soft);
}

.card__shot img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  transition: transform 1.2s var(--ease), filter 0.8s var(--ease-soft);
  filter: saturate(0.92);
}

.card:hover .card__shot img {
  transform: scale(1.04);
  filter: saturate(1);
}

.card:hover {
  border-color: color-mix(in srgb, var(--accent) 42%, transparent);
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.card__num {
  display: block;
  font-size: var(--t-eyebrow);
  letter-spacing: 0.16em;
  color: var(--accent);
  margin-bottom: 0.9rem;
}

.card h3 {
  font-size: var(--t-h3);
  font-weight: 500;
  margin-bottom: 0.7rem;
}

.card p {
  font-size: 0.95rem;
  color: var(--text-2);
}

/* --- how --------------------------------------------------------------- */

.how {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.85fr);
  gap: clamp(2.5rem, 6vw, 5rem);
  align-items: start;
}

.how__text p {
  margin-top: 1.25rem;
  max-width: 48ch;
  color: var(--text-2);
}

.how__text .section__title {
  margin-bottom: 0.25rem;
}

.steps {
  list-style: none;
  padding: 0;
  margin: 0;
  position: relative;
}

.steps::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 0.55rem;
  bottom: 0.55rem;
  width: 1px;
  background: var(--line);
}

.steps li {
  position: relative;
  padding-left: 2rem;
  padding-bottom: 1.8rem;
}

.steps li:last-child {
  padding-bottom: 0;
}

.steps__dot {
  position: absolute;
  left: 0;
  top: 0.45rem;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--bg-2);
  border: 1px solid var(--accent);
}

.steps h3 {
  font-size: 1rem;
  font-weight: 500;
  font-family: 'Inter', sans-serif;
  letter-spacing: 0.01em;
}

.steps p {
  font-size: 0.925rem;
  color: var(--text-3);
  margin-top: 0.2rem;
}

@media (max-width: 54rem) {
  .how {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* --- contact ----------------------------------------------------------- */

.contact {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1fr);
  gap: clamp(2.5rem, 6vw, 4.5rem);
  align-items: start;
}

.contact__text p {
  margin-top: 1.25rem;
  max-width: 44ch;
  color: var(--text-2);
}

.contact__mail {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  margin-top: 2rem;
  font-family: 'Fraunces', ui-serif, Georgia, serif;
  font-size: clamp(1.15rem, 2.2vw, 1.5rem);
  color: var(--text);
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.35rem;
  transition: color 0.3s var(--ease), border-color 0.3s var(--ease);
}

.contact__mail svg {
  width: 20px;
  height: 20px;
  flex: none;
  color: var(--accent);
}

.contact__mail:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.contact__note {
  font-size: var(--t-small);
  color: var(--text-3);
  margin-top: 1.1rem !important;
}

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

.form {
  padding: clamp(1.5rem, 3vw, 2.25rem);
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  display: grid;
  gap: 1.05rem;
  transition: background-color 0.4s var(--ease), border-color 0.4s var(--ease);
}

.field {
  display: grid;
  gap: 0.4rem;
}

.field label {
  font-size: var(--t-small);
  font-weight: 500;
  color: var(--text-2);
}

.field .opt {
  font-weight: 300;
  color: var(--text-3);
}

.field input,
.field textarea {
  width: 100%;
  padding: 0.72rem 0.9rem;
  font: inherit;
  font-size: 0.95rem;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 9px;
  transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease),
    background-color 0.4s var(--ease);
}

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

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.field input[aria-invalid='true'],
.field textarea[aria-invalid='true'] {
  border-color: #c2452f;
}

.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form__submit {
  justify-self: start;
  margin-top: 0.35rem;
}

.form__submit[disabled] {
  opacity: 0.6;
  cursor: progress;
}

.form__status {
  font-size: var(--t-small);
  color: var(--text-3);
  min-height: 1.3em;
}

.form__status.is-ok {
  color: var(--accent);
}

.form__status.is-error {
  color: #c2452f;
}

:root[data-theme='dark'] .form__status.is-error {
  color: #f08a76;
}

@media (max-width: 54rem) {
  .contact {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* --- footer ------------------------------------------------------------ */

.site-foot {
  border-top: 1px solid var(--line-soft);
  padding-block: 2.25rem;
  font-size: var(--t-small);
  color: var(--text-3);
}

.foot-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
}

.foot-brand {
  font-family: 'Fraunces', ui-serif, Georgia, serif;
  font-size: 1rem;
  color: var(--text-2);
}

.foot-inner a {
  color: var(--text-2);
  transition: color 0.3s var(--ease);
}

.foot-inner a:hover {
  color: var(--accent);
}

.foot-year {
  margin-left: auto;
}

@media (max-width: 34rem) {
  .foot-year {
    margin-left: 0;
    width: 100%;
  }
}

/* --- reveal on scroll --------------------------------------------------- */

[data-reveal] {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
  transition-delay: var(--reveal-delay, 0ms);
}

[data-reveal].is-in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  [data-reveal] {
    opacity: 1;
    transform: none;
  }
}
