/* AO „Moștenitorii” - site styles
   Theme: follows the system (light / dark), whole page switches together.
   Shape rule: photos and panels use --radius; buttons are full pill. */

@font-face {
  font-family: "Onest";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/onest-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Onest";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/onest-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  color-scheme: light dark;

  --bg: #f2f4f0;
  --surface: #e6eae3;
  --tint: #dbe8de;
  --text: #151d18;
  --muted: #4a574f;
  --line: #cdd4cb;
  --line-strong: #7a867d;
  --accent: #1d5a3c;
  --accent-hover: #154831;
  --on-accent: #f2f4f0;

  --radius: 14px;
  --container: 1240px;
  --gutter: clamp(16px, 4vw, 40px);
  --section-space: clamp(4.5rem, 9vw, 7.5rem);
  --font: "Onest", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1310;
    --surface: #161d19;
    --tint: #14261c;
    --text: #e3e8e3;
    --muted: #a2afa6;
    --line: #28322c;
    --line-strong: #6a776e;
    --accent: #8fd0a8;
    --accent-hover: #aadfbe;
    --on-accent: #0e1310;
  }
}

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

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

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
}

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

h1,
h2,
h3,
p,
dl,
dd,
ul,
figure,
blockquote {
  margin: 0;
}

ul {
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
}

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

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

[id] {
  scroll-margin-top: 1.5rem;
}

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

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  padding: 0.6rem 1rem;
  background: var(--accent);
  color: var(--on-accent);
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  top: 12px;
  color: var(--on-accent);
}

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

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: 80px;
}

/* Logo: transparent PNG with black ink, inverted to light ink in dark mode */
.brand {
  display: block;
  flex-shrink: 0;
}

.logo {
  width: auto;
  height: 64px;
}

@media (prefers-color-scheme: dark) {
  .logo {
    filter: invert(0.9);
  }
}

.site-nav ul {
  display: flex;
  align-items: center;
  gap: clamp(0.9rem, 2.4vw, 2rem);
}

.site-nav a {
  font-size: 0.96875rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}

.site-nav a:hover {
  text-decoration: underline;
}

.lang-link {
  display: inline-block;
  padding: 0.25rem 0.7rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-size: 0.8125rem !important;
  font-weight: 600 !important;
  letter-spacing: 0.02em;
}

.lang-link:hover {
  border-color: var(--accent);
  text-decoration: none !important;
}

@media (max-width: 479px) {
  .nav-optional {
    display: none;
  }

  .logo {
    height: 52px;
  }
}

@media (max-width: 359px) {
  .site-nav ul {
    gap: 0.75rem;
  }

  .site-nav a {
    font-size: 0.9375rem;
  }
}

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

.hero {
  padding-block: clamp(1.5rem, 4vw, 3.5rem) var(--section-space);
}

.hero .container {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(2rem, 4vw, 3.5rem) 1.5rem;
  align-items: end;
}

.hero__text {
  grid-column: 1 / span 5;
  padding-bottom: 2.25rem;
}

.hero h1 {
  font-size: clamp(3rem, 6.2vw, 5.25rem);
  font-weight: 650;
  line-height: 1.06;
  letter-spacing: -0.04em;
  padding-bottom: 0.08em;
}

.hero__lede {
  margin-top: 1.25rem;
  max-width: 34ch;
  font-size: clamp(1.125rem, 1.6vw, 1.3125rem);
  line-height: 1.5;
  color: var(--muted);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
}

.hero__media {
  grid-column: 6 / -1;
}

.hero__media img {
  width: 100%;
  height: clamp(360px, 62dvh, 620px);
  object-fit: cover;
  object-position: 40% 60%;
  border-radius: var(--radius);
  background: var(--surface);
}

.hero__media figcaption {
  margin-top: 0.7rem;
  font-size: 0.875rem;
  color: var(--muted);
}

@media (max-width: 899px) {
  .hero .container {
    align-items: start;
  }

  .hero__text,
  .hero__media {
    grid-column: 1 / -1;
  }

  .hero__text {
    padding-bottom: 0;
  }

  .hero__media img {
    height: auto;
    aspect-ratio: 4 / 3;
  }
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.7rem 1.5rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

@media (prefers-reduced-motion: no-preference) {
  .btn {
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
  }
}

.btn:active {
  transform: translateY(1px);
}

.btn--primary {
  background: var(--accent);
  color: var(--on-accent);
}

.btn--primary:hover {
  background: var(--accent-hover);
  color: var(--on-accent);
}

.btn--secondary {
  border-color: var(--line-strong);
  color: var(--text);
}

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

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

.section {
  padding-block: var(--section-space);
  border-top: 1px solid var(--line);
}

.section-title {
  font-size: clamp(1.875rem, 3.4vw, 2.75rem);
  font-weight: 650;
  line-height: 1.12;
  letter-spacing: -0.03em;
}

/* About: heading column on the left, content on the right */

.about .container {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 2.5rem 1.5rem;
}

.about__head {
  grid-column: 1 / span 4;
}

.about__head p {
  margin-top: 1.1rem;
  max-width: 36ch;
  color: var(--muted);
}

.about__body {
  grid-column: 5 / -1;
}

.mission blockquote p {
  font-size: clamp(1.375rem, 2.1vw, 1.875rem);
  font-weight: 500;
  line-height: 1.34;
  letter-spacing: -0.018em;
  max-width: 50ch;
  text-wrap: pretty;
}

.mission figcaption {
  margin-top: 1rem;
  font-size: 0.9375rem;
  color: var(--muted);
}

.focus-lists {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2.5rem 2rem;
  margin-top: clamp(2.75rem, 5vw, 4rem);
  padding-top: 2rem;
  border-top: 1px solid var(--line);
}

.focus-lists h3 {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--muted);
}

.focus-lists ul {
  margin-top: 0.9rem;
  display: grid;
  gap: 0.55rem;
}

.focus-lists li {
  font-size: 1.125rem;
  font-weight: 500;
  line-height: 1.4;
}

@media (max-width: 899px) {
  .about__head,
  .about__body {
    grid-column: 1 / -1;
  }
}

@media (max-width: 559px) {
  .focus-lists {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Projects: asymmetric 7/5 then 5/7 grid */

.projects-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(2.5rem, 4vw, 3.5rem) clamp(1.25rem, 2.4vw, 2rem);
  margin-top: clamp(2.25rem, 4vw, 3.25rem);
}

.project {
  display: flex;
  flex-direction: column;
}

.project--wide {
  grid-column: span 7;
}

.project--narrow {
  grid-column: span 5;
}

.project img {
  width: 100%;
  height: clamp(240px, 26vw, 340px);
  object-fit: cover;
  border-radius: var(--radius);
  background: var(--surface);
}

.project__body {
  padding-top: 1.25rem;
}

.project__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 1rem;
  font-size: 0.9375rem;
  color: var(--muted);
}

.project__meta strong {
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.project h3 {
  margin-top: 0.5rem;
  font-size: clamp(1.3125rem, 2vw, 1.625rem);
  font-weight: 620;
  line-height: 1.22;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.project__summary {
  margin-top: 0.7rem;
  max-width: 58ch;
}

.project__partners {
  margin-top: 0.9rem;
  max-width: 58ch;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--muted);
}

/* Text-only project: tinted panel, same height as its row neighbour.
   Title sits at the top, details at the bottom. */
.project--panel {
  justify-content: space-between;
  gap: 2.5rem;
  padding: clamp(1.5rem, 3vw, 2.5rem);
  background: var(--tint);
  border-radius: var(--radius);
}

.project--panel .project__body {
  padding-top: 0;
}

.project--panel h3 {
  margin-top: 0.75rem;
  font-size: clamp(2rem, 3.6vw, 3.25rem);
  line-height: 1.08;
  letter-spacing: -0.035em;
}

@media (max-width: 899px) {
  .project--wide,
  .project--narrow {
    grid-column: 1 / -1;
  }

  .project img {
    height: auto;
    aspect-ratio: 16 / 10;
  }

  .project--panel {
    min-height: 0;
  }
}

/* Contact + registration details */

.contact .container {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 3rem 1.5rem;
  align-items: start;
}

.contact__main {
  grid-column: 1 / span 6;
}

.contact__email {
  display: inline-block;
  margin-top: 1.75rem;
  font-size: clamp(1.375rem, 3vw, 2.25rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.contact__list {
  display: grid;
  gap: 1.25rem;
  margin-top: 2.25rem;
}

.contact__list dt,
.registry dt {
  font-size: 0.875rem;
  color: var(--muted);
}

.contact__list dd {
  margin-top: 0.15rem;
  font-size: 1.125rem;
  font-weight: 500;
}

.contact__list dd a {
  text-decoration-color: var(--line-strong);
}

.phones {
  display: flex;
  flex-wrap: wrap;
  gap: 0.1rem 1.5rem;
  font-variant-numeric: tabular-nums;
}

.registry {
  grid-column: 8 / -1;
  padding: clamp(1.5rem, 3vw, 2.25rem);
  background: var(--surface);
  border-radius: var(--radius);
}

.registry h3 {
  font-size: 1.125rem;
  font-weight: 620;
}

.registry__group {
  display: grid;
  gap: 1rem;
  padding-block: 1.4rem;
}

.registry__group + .registry__group {
  border-top: 1px solid var(--line);
}

.registry__group:last-child {
  padding-bottom: 0;
}

.registry dd {
  margin-top: 0.1rem;
  font-weight: 500;
  line-height: 1.45;
}

.registry__ids {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.registry__ids dd {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  font-variant-numeric: tabular-nums;
}

.registry__note {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.9375rem;
  font-weight: 400;
  color: var(--muted);
}

@media (max-width: 899px) {
  .contact__main,
  .registry {
    grid-column: 1 / -1;
  }
}

@media (max-width: 379px) {
  .registry__ids {
    grid-template-columns: minmax(0, 1fr);
  }
}

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

.site-footer {
  padding-block: 2.5rem 3rem;
  border-top: 1px solid var(--line);
  font-size: 0.875rem;
  color: var(--muted);
}

.site-footer .container {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 1.75rem 1.5rem;
}

.footer__org {
  grid-column: 1 / span 4;
}

.footer__logo {
  height: 84px;
  margin-bottom: 1.25rem;
}

.footer__org strong {
  display: block;
  font-weight: 600;
  color: var(--text);
}

.footer__credits {
  grid-column: 6 / -1;
}

.footer__credits h2 {
  font-size: inherit;
  font-weight: 600;
  color: var(--text);
}

.footer__credits ul {
  display: grid;
  gap: 0.3rem;
  margin-top: 0.5rem;
}

@media (max-width: 899px) {
  .footer__org,
  .footer__credits {
    grid-column: 1 / -1;
  }
}

/* ---------- 404 ---------- */

.not-found {
  min-height: calc(100dvh - 80px - 9rem);
  display: grid;
  align-content: center;
  padding-block: 4rem;
}

.not-found p {
  margin-top: 1rem;
  max-width: 44ch;
  color: var(--muted);
}
