/* Simona di Punzio, sul confine — site styles */

/* ---------- Fonts ---------- */
@font-face {
  font-family: 'Jost';
  src: url('/fonts/jost-latin-wght-normal.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Jost';
  src: url('/fonts/jost-latin-wght-italic.woff2') format('woff2');
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  --color-brand: #93248a;      /* top accent line */
  --color-ink: #434746;        /* nav, display name */
  --color-text: #66726f;       /* body copy (slightly darkened from #75827f for AA contrast) */
  --color-text-mist: #535e5b;  /* body copy on the mint band */
  --color-accent: #a7b8b4;     /* rules, active nav */
  --color-button: #66726f;     /* darker than the design's #a7b8b4 so white text passes AA (5:1) */
  --color-button-hover: #545f5c;
  --color-field-border: #7f8c89; /* >= 3:1 against the form background */
  --color-rule-strong: #75827f;
  --color-label: #414141;
  --color-link: #282626;
  --color-mist: #d7e1df;
  --color-paper: #f2f2f2;
  --color-footer: #414544;
  --color-footer-text: #eeefef;
  --color-white: #fff;
  --color-error: #a3262a;

  --font-sans: 'Jost', 'Futura', 'Century Gothic', 'Avenir Next', system-ui, sans-serif;

  --header-h: 64px;
  --gutter: 24px;
  --col-pad: var(--gutter);
  --rule-w: 60px;
  --lh-tight: 1.4;
  --lh-loose: 1.8;
}

@media (min-width: 600px) {
  :root { --gutter: 40px; }
}
@media (min-width: 900px) {
  :root { --col-pad: clamp(40px, 5.5vw, 64px); }
}
@media (min-width: 1200px) {
  /* Inner padding of each half column: ~121px at a 1470px-wide viewport, as in the design. */
  :root { --col-pad: clamp(64px, 8.25vw, 160px); }
}
@media (min-width: 1100px) {
  :root { --header-h: 101px; --scroll-pad: 0px; }
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: var(--scroll-pad, var(--header-h));
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
html.nav-open { overflow: hidden; }

body {
  margin: 0;
  background: var(--color-white);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-weight: 300;
  font-size: 16px;
  line-height: var(--lh-tight);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-weight: 300; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
em { font-style: italic; }

main:focus { outline: none; }

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

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

.skip-link {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--color-white);
  color: var(--color-ink);
  font-size: 16px;
  transform: translateY(-200%);
}
.skip-link:focus { transform: none; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-top: 3px solid var(--color-brand);
  background: var(--color-white);
}

.site-header__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: var(--header-h);
  padding-inline: var(--gutter) calc(var(--gutter) - 10px);
}

.site-header__brand {
  color: var(--color-ink);
  font-size: 18px;
  letter-spacing: 0.01em;
  text-decoration: none;
  white-space: nowrap;
}

.site-nav__list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav__link {
  color: var(--color-ink);
  text-decoration: none;
  transition: color 0.2s ease;
}
.site-nav__link:hover,
.site-nav__link[aria-current='page'] { color: var(--color-accent); }

/* Mobile / tablet menu */
.nav-toggle {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--color-ink);
  cursor: pointer;
}
.nav-toggle__icon,
.nav-toggle__icon::before,
.nav-toggle__icon::after {
  display: block;
  width: 24px;
  height: 1.5px;
  background: currentColor;
  transition: transform 0.25s ease, opacity 0.2s ease;
}
.nav-toggle__icon { position: relative; }
.nav-toggle__icon::before,
.nav-toggle__icon::after {
  content: '';
  position: absolute;
  left: 0;
}
.nav-toggle__icon::before { top: -7px; }
.nav-toggle__icon::after { top: 7px; }
.is-open .nav-toggle__icon { background: transparent; }
.is-open .nav-toggle__icon::before { transform: translateY(7px) rotate(45deg); }
.is-open .nav-toggle__icon::after { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 1099.98px) {
  .site-header { box-shadow: 0 1px 0 rgb(0 0 0 / 0.06); }

  .site-nav {
    position: fixed;
    inset: calc(var(--header-h) + 3px) 0 0;
    overflow-y: auto;
    padding: 32px var(--gutter) 48px;
    background: var(--color-white);
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.2s ease, visibility 0s linear 0.2s;
  }
  .is-open .site-nav {
    visibility: visible;
    opacity: 1;
    transition: opacity 0.2s ease;
  }
  .site-nav__link {
    display: block;
    padding: 12px 0;
    font-size: 26px;
    line-height: 1.3;
  }
}

@media (min-width: 1100px) {
  /* Desktop: header floats over the top of the first section, as in the design. */
  .site-header {
    position: absolute;
    inset: 0 0 auto;
    background: transparent;
  }
  .site-header__bar {
    padding-inline: clamp(32px, 4.3vw, 96px) clamp(32px, 3.75vw, 96px);
  }
  .site-header__brand {
    font-size: clamp(18px, 1.33vw, 22px);
    margin-top: 6px;
  }
  .nav-toggle { display: none; }
  .site-nav__list {
    display: flex;
    gap: clamp(20px, 2.25vw, 44px);
  }
  .site-nav__link {
    font-size: clamp(16px, 1.25vw, 20px);
    white-space: nowrap;
  }
}

/* ---------- Split layout (photo | text) ---------- */
.split {
  display: flex;
  flex-direction: column;
  background: var(--color-white);
}

.split__media {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--color-paper);
}
@media (min-width: 600px) {
  .split__media { aspect-ratio: 4 / 3; }
}

.split__media picture { display: contents; }
.cover {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.split__body { display: flex; }
.split__inner {
  width: 100%;
  max-width: 640px;
  padding: 48px var(--gutter) 64px;
}

@media (min-width: 900px) {
  .split {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .split__media { aspect-ratio: auto; }
  .split--media-end .split__media { order: 2; }
  .split__inner {
    max-width: calc(560px + 2 * var(--col-pad));
    padding: 120px var(--col-pad) 120px;
  }
}

/* Per-photo framing (desktop column crop / stacked crop) */
.img--hero { object-position: 50% 50%; }
.img--contact { object-position: 50% 60%; }
.img--scrittura { object-position: 50% 70%; }
.img--mestieri { object-position: 50% 28%; }
.img--casa { object-position: 50% 62%; }
.img--visione { object-position: 50% 50%; }
@media (min-width: 600px) and (max-width: 899.98px) {
  .img--hero { object-position: 50% 30%; }
  .img--mestieri { object-position: 50% 32%; }
  .img--scrittura { object-position: 50% 72%; }
  .img--casa { object-position: 50% 50%; }
  .img--contact { object-position: 50% 62%; }
}
@media (min-width: 900px) {
  .img--scrittura,
  .img--mestieri,
  .img--casa { object-position: 50% 50%; }
}

/* ---------- Typography helpers ---------- */
.prose p + p { margin-top: 0; }
.prose--loose { line-height: var(--lh-loose); }
.prose--spaced p + p,
.prose .prose__gap { margin-top: calc(1em * var(--lh-tight)); }
.prose--loose .prose__gap { margin-top: calc(1em * var(--lh-loose)); }

@media (min-width: 1200px) {
  .prose--justify,
  .prose--justify p {
    text-align: justify;
    hyphens: manual;
  }
}

.heading {
  color: var(--color-text);
  font-size: 22px;
  line-height: 1.2;
}
.heading--ruled::after {
  content: '';
  display: block;
  width: var(--rule-w);
  height: 2px;
  margin-top: 18px;
  background: var(--color-accent);
}

.text-link {
  display: inline-block;
  margin-top: 10px;
  color: var(--color-link);
  font: inherit;
  line-height: 1.3;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}
.text-link[href]:hover { color: var(--color-text); }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 20px;
  border: 0;
  border-radius: 0;
  background: var(--color-button);
  color: var(--color-white);
  font: inherit;
  font-size: 15px;
  letter-spacing: 0.1em;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s ease;
}
.button[href]:hover,
button.button:hover { background: var(--color-button-hover); }
.button:disabled { cursor: progress; opacity: 0.7; }
.button--block {
  width: 100%;
  font-size: 18px;
  letter-spacing: 0.01em;
}

/* ---------- Home: hero ---------- */
.hero__title {
  color: var(--color-ink);
  font-size: clamp(50px, 9vw, 76px);
  line-height: 1;
  letter-spacing: -0.005em;
}
.hero__title span { display: block; }

.hero__subtitle {
  position: relative;
  margin-top: 24px;
  padding-left: 54px;
  font-size: 19px;
  line-height: 1.35;
}
.hero__subtitle::before {
  content: '';
  position: absolute;
  top: 0.67em;
  left: 0;
  width: 40px;
  height: 2px;
  background: var(--color-accent);
}
.hero__intro { margin-top: 36px; }

@media (min-width: 900px) {
  .hero__title { font-size: clamp(64px, 6.85vw, 116px); }
  .hero .split__inner { padding-top: 96px; padding-bottom: 96px; }
}
@media (min-width: 1100px) {
  .hero .split__inner { padding-top: 136px; padding-bottom: 110px; }
  .hero { min-height: min(60.7vw, 1150px); }
}
@media (min-width: 1200px) {
  /* Design layout: rule, then the subtitle on two set lines. */
  .hero__subtitle {
    margin: 20px 0 0 5px;
    padding-left: 75px;
    font-size: clamp(20px, 1.65vw, 26px);
    line-height: 1.32;
  }
  .hero__subtitle::before { width: 60px; top: 0.62em; }
  .hero__subtitle span { display: block; }
  .hero__intro { margin-top: 45px; }
}

/* ---------- Home: aree di competenza ---------- */
.areas {
  display: grid;
  gap: 32px;
  padding: 64px var(--gutter) 72px;
  background: var(--color-mist);
  color: var(--color-text-mist);
}
.areas .heading { color: var(--color-text-mist); font-size: 24px; }
.areas .heading--ruled::after { margin-top: 26px; background: var(--color-rule-strong); }
.areas__lead {
  margin-top: 32px;
  font-size: 22px;
  line-height: 1.55;
}
.areas__intro,
.areas__body { width: 100%; max-width: 592px; }
.areas__body { display: grid; justify-items: center; }
.areas__body .prose { justify-self: stretch; }
.areas__cta { margin-top: 40px; }

@media (min-width: 900px) {
  .areas {
    grid-template-columns: 1fr 1fr;
    gap: 0;
    min-height: 725px;
    padding: 0;
  }
  .areas__intro,
  .areas__body {
    max-width: calc(560px + 2 * var(--col-pad));
    padding: 166px var(--col-pad) 140px;
  }
  .areas .heading { font-size: clamp(22px, 1.67vw, 28px); }
  .areas__lead { margin-top: 42px; font-size: clamp(20px, 1.55vw, 25px); line-height: 1.65; }
  .areas__cta { margin-top: 64px; padding-inline: 14px; min-height: 40px; }
}

/* ---------- Home: contact ---------- */
.contact .split__body { background: var(--color-paper); }
.contact .split__media { aspect-ratio: 4 / 3; }
.contact .heading { font-size: 24px; }
.contact .heading--ruled::after { margin-top: 26px; background: var(--color-rule-strong); }
.contact__intro { margin-top: 40px; }

.contact-form {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px 20px;
  margin-top: 40px;
}
@media (min-width: 480px) {
  .contact-form { grid-template-columns: 1fr 1fr; padding-inline: 6px; }
  .field--wide,
  .contact-form__submit,
  .contact-form__status { grid-column: 1 / -1; }
}
.contact-form__submit { margin-top: 6px; grid-column: 1 / -1; }
.contact-form__challenge { grid-column: 1 / -1; }
.contact-form__challenge:empty { display: none; }
.contact-form__privacy {
  grid-column: 1 / -1;
  color: var(--color-label);
  font-size: 14px;
  line-height: 1.45;
}

.field { display: grid; gap: 8px; align-content: start; }
.field label {
  color: var(--color-label);
  font-size: 16px;
  line-height: 1.3;
}
.field input,
.field textarea {
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--color-field-border);
  border-radius: 0;
  background: var(--color-white);
  color: var(--color-label);
  font: inherit;
  font-size: 16px;
  appearance: none;
}
.field textarea { height: 92px; resize: vertical; }
.field input:focus-visible,
.field textarea:focus-visible {
  border-color: var(--color-ink);
  outline: 1px solid var(--color-ink);
  outline-offset: 0;
}
.field [aria-invalid='true'] { border-color: var(--color-error); }
.field__error {
  color: var(--color-error);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.35;
}
/* Honeypot: invisible to people, still in the DOM for bots that fill every field. */
.contact-form__trap {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.contact-form__status:empty { display: none; }
.contact-form__status {
  grid-column: 1 / -1;
  color: var(--color-ink);
  font-size: 16px;
}
.contact-form__status[data-tone='error'] { color: var(--color-error); }

@media (min-width: 900px) {
  .contact { min-height: 738px; }
  .contact .split__media { aspect-ratio: auto; }
  .contact .split__inner { padding-top: 52px; padding-bottom: 36px; }
  .contact .heading { font-size: clamp(22px, 1.67vw, 28px); }
  .contact__intro { margin-top: 38px; }
  .contact-form { margin-top: 48px; gap: 17px 20px; }
}

/* ---------- Inner pages ---------- */
.page-intro__title {
  color: var(--color-text);
  font-size: 24px;
  line-height: 1.2;
}
.page-intro .text-link { margin-top: 8px; }
.page-intro + .text-block { margin-top: 64px; }
.text-block .prose { margin-top: 32px; }
.text-block + .text-block { margin-top: 56px; }

@media (min-width: 900px) {
  .page-intro__title { font-size: clamp(22px, 1.67vw, 28px); }
  .page-split .split__inner { padding-top: 176px; padding-bottom: 160px; }
  .page-split .heading { font-size: clamp(20px, 1.54vw, 26px); }
  .page-intro + .text-block { margin-top: 106px; }
  .page-intro--plain + .text-block { margin-top: 70px; }
  .text-block .prose { margin-top: 36px; }
  .text-block + .text-block { margin-top: 60px; }

  /* Section heights follow the photo proportions of the design. */
  .page-split--scrittura { min-height: min(94vw, 1700px); }
  .page-split--casa { min-height: min(85vw, 1560px); }
  .page-split--visione { min-height: min(79vw, 1440px); }
  .page-split--visione .split__inner { padding-top: 148px; }
  .page-split--mestieri .split__inner { padding-top: 190px; padding-bottom: 80px; }
}
@media (max-width: 899.98px) {
  .page-split--visione .split__media { order: -1; }
}

/* ---------- 404 ---------- */
.not-found {
  display: grid;
  justify-items: start;
  gap: 16px;
  max-width: 640px;
  min-height: 60vh;
  padding: 120px var(--gutter);
  margin-inline: auto;
}
@media (min-width: 1100px) {
  .not-found { padding-top: 220px; }
}

/* ---------- Legal pages ---------- */
.legal {
  max-width: 760px;
  padding: 120px var(--gutter) 96px;
  margin-inline: auto;
}
.legal__intro { margin-top: 32px; }
.legal__list {
  margin: calc(1em * var(--lh-tight)) 0;
  padding-left: 1.2em;
  list-style: disc;
}
.legal__list li + li { margin-top: 0.4em; }
.legal strong { font-weight: 500; }
@media (min-width: 1100px) {
  .legal { padding-top: 200px; }
}

/* ---------- Footer ---------- */
.site-footer {
  display: grid;
  place-items: center;
  min-height: 49px;
  padding: 12px var(--gutter);
  background: var(--color-footer);
  color: var(--color-footer-text);
  font-size: 15px;
  text-align: center;
}
@media (min-width: 900px) {
  .site-footer { font-size: 16px; }
}
.site-footer__link { color: inherit; text-decoration: underline; text-underline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
