/* =========================================================
   Lincei Labs — modern editorial glass over Renaissance fresco
   ========================================================= */

:root {
  color-scheme: light;

  --paper:        #f3ead8;
  --paper-warm:   #ead7b9;
  --paper-glass:  rgba(255, 249, 236, 0.52);
  --ink:          #16120f;
  --ink-soft:     #352c25;
  --muted:        #75685a;
  --rule:         rgba(22, 18, 15, 0.14);
  --rule-strong:  rgba(22, 18, 15, 0.26);
  --bordeaux:     #731f35;
  --bordeaux-deep:#40101d;
  --gold:         #b68a48;
  --sage:         #7f967e;

  --serif: "Cormorant Garamond", "EB Garamond", Georgia, serif;
  --sans:  "Instrument Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono:  "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --w:     min(100% - 40px, 1180px);
  --w-tight: min(100% - 40px, 840px);
  --radius-xl: 34px;
  --radius-md: 20px;
  --shadow: 0 28px 80px -48px rgba(22, 18, 15, 0.55);
}

* { box-sizing: border-box; }

html {
  min-width: 320px;
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: clip;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  background-color: var(--paper);
  background-image: url("assets/fresco-bg.jpg");
  background-size: cover;
  background-position: center top;
  background-attachment: fixed;
  background-repeat: no-repeat;
}

@media (max-width: 900px) {
  body {
    background-image: url("assets/fresco-bg-mobile.jpg");
    background-attachment: scroll;
    background-size: 100% auto;
  }
}

/* cream wash so the fresco sits quietly behind content */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 12% 14%, rgba(255, 249, 236, 0.7) 0, rgba(255, 249, 236, 0) 28%),
    radial-gradient(circle at 82% 12%, rgba(115, 31, 53, 0.14) 0, rgba(115, 31, 53, 0) 31%),
    radial-gradient(circle at 72% 80%, rgba(127, 150, 126, 0.16) 0, rgba(127, 150, 126, 0) 34%),
    linear-gradient(
      180deg,
      rgba(243, 234, 216, 0.10) 0%,
      rgba(243, 234, 216, 0.62) 100%
    );
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.34;
  background-image:
    linear-gradient(rgba(22, 18, 15, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(22, 18, 15, 0.04) 1px, transparent 1px);
  background-size: 88px 88px;
  mask-image: linear-gradient(180deg, black, transparent 82%);
}

main, footer, .site-head { position: relative; z-index: 1; }

a { color: inherit; }

::selection {
  background: var(--bordeaux);
  color: var(--paper);
}

/* =========================================================
   HEADER
   ========================================================= */
.site-head {
  width: var(--w);
  margin: 0 auto;
  padding: 22px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
}

.brand,
.nav {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.58);
  background: rgba(255, 249, 236, 0.44);
  backdrop-filter: blur(22px) saturate(170%);
  -webkit-backdrop-filter: blur(22px) saturate(170%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.64),
    0 18px 46px -34px rgba(22, 18, 15, 0.45);
}

.brand {
  gap: 11px;
  min-height: 46px;
  padding: 7px 16px 7px 8px;
  border-radius: 999px;
  color: var(--ink);
  font-weight: 700;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.brand__sigil {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  border-radius: 50%;
  color: var(--paper);
  background: linear-gradient(135deg, var(--ink), var(--bordeaux));
  font-family: var(--serif);
  font-size: 1.08rem;
  font-weight: 600;
  line-height: 1;
}

.nav {
  gap: 4px;
  min-height: 46px;
  padding: 5px;
  border-radius: 999px;
}

.nav a {
  padding: 9px 13px;
  border-radius: 999px;
  color: var(--ink-soft);
  font-size: 0.86rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 180ms ease, color 180ms ease;
}

.nav a:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.42);
}

/* =========================================================
   HERO
   ========================================================= */
.hero {
  position: relative;
  min-height: calc(100svh - 68px);
  width: var(--w);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  align-items: center;
  padding: clamp(96px, 13vh, 132px) 0 clamp(104px, 15vh, 158px);
  text-align: center;
}

.hero__content {
  max-width: 860px;
}

.hero__label {
  position: absolute;
  top: clamp(22px, 5vh, 54px);
  left: 50%;
  z-index: 2;
  margin: 0;
  padding: 10px 15px;
  transform: translateX(-50%) rotate(-2deg);
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 999px;
  color: var(--paper);
  background: linear-gradient(135deg, rgba(115, 31, 53, 0.92), rgba(64, 16, 29, 0.9));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 18px 42px -28px rgba(64, 16, 29, 0.82);
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
}

.display {
  margin: 0;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(3.7rem, 8vw, 7.8rem);
  line-height: 0.88;
  letter-spacing: -0.055em;
  color: var(--ink);
  text-wrap: balance;
}
.display__line { display: block; }
.display__line--italic {
  font-style: italic;
  font-weight: 400;
  color: var(--bordeaux);
  letter-spacing: -0.035em;
}
.display strong {
  font-weight: 600;
  font-style: normal;
  color: var(--ink);
}

.lede {
  max-width: 620px;
  margin: clamp(30px, 4vh, 46px) auto 0;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: clamp(1.25rem, 1.8vw, 1.62rem);
  line-height: 1.55;
}

/* Buttons — frosted pills */
.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: clamp(30px, 5vh, 50px);
}

.button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 52px;
  min-width: 138px;
  padding: 14px 18px 14px 22px;
  font-family: var(--sans);
  font-weight: 700;
  font-size: 0.92rem;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
  background: rgba(255, 249, 236, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 999px;
  backdrop-filter: blur(18px) saturate(180%);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.62),
    inset 0 -1px 0 rgba(22, 18, 15, 0.06),
    0 1px 2px rgba(22, 18, 15, 0.04),
    0 18px 38px -28px rgba(22, 18, 15, 0.45);
  transition:
    background 220ms ease,
    color 220ms ease,
    border-color 220ms ease,
    transform 220ms ease,
    box-shadow 220ms ease;
}
.button:hover {
  background: rgba(255, 249, 236, 0.66);
  border-color: rgba(255, 255, 255, 0.82);
  transform: translateY(-2px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.74),
    inset 0 -1px 0 rgba(22, 18, 15, 0.06),
    0 2px 8px rgba(22, 18, 15, 0.06),
    0 24px 48px -30px rgba(22, 18, 15, 0.55);
}
.button:hover .button__arrow { transform: translateX(3px); }
.button:active { transform: translateY(0); }

.button__arrow {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(22, 18, 15, 0.08);
  transition: transform 220ms ease;
  font-family: var(--sans);
  font-size: 0.92rem;
}

.button--primary {
  color: var(--paper);
  background: linear-gradient(135deg, rgba(22, 18, 15, 0.94), rgba(64, 16, 29, 0.9));
  border-color: rgba(22, 18, 15, 0.9);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.15),
    inset 0 -1px 0 rgba(0, 0, 0, 0.2),
    0 1px 2px rgba(22, 18, 15, 0.1),
    0 24px 48px -30px rgba(22, 18, 15, 0.72);
}
.button--primary:hover {
  background: linear-gradient(135deg, rgba(115, 31, 53, 0.94), rgba(64, 16, 29, 0.92));
  border-color: rgba(106, 27, 42, 0.95);
  color: var(--paper);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    inset 0 -1px 0 rgba(0, 0, 0, 0.22),
    0 2px 4px rgba(106, 27, 42, 0.15),
    0 18px 36px -16px rgba(106, 27, 42, 0.6);
}
.button--primary .button__arrow {
  background: rgba(255, 249, 236, 0.16);
}

/* =========================================================
   NOTE
   ========================================================= */
.note {
  width: var(--w-tight);
  margin: 0 auto;
  padding: clamp(82px, 14vh, 160px) 0 clamp(54px, 7vh, 92px);
}

.note__body {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.62rem, 3vw, 2.45rem);
  line-height: 1.25;
  color: var(--ink);
  letter-spacing: -0.035em;
  text-align: center;
  text-wrap: balance;
}
.note__body em {
  color: var(--bordeaux);
  font-style: italic;
}

/* =========================================================
   WORKS
   ========================================================= */
.works {
  width: var(--w);
  margin: 0 auto;
  padding: clamp(48px, 7vh, 92px) 0 clamp(96px, 14vh, 160px);
}

.works__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.work {
  position: relative;
  min-height: 360px;
  padding: clamp(30px, 4vw, 44px);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(255, 252, 246, 0.78)),
    rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 28px;
  backdrop-filter: blur(28px) saturate(155%);
  -webkit-backdrop-filter: blur(28px) saturate(155%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    inset 0 -1px 0 rgba(22, 18, 15, 0.05),
    0 1px 2px rgba(22, 18, 15, 0.03),
    0 26px 70px -48px rgba(22, 18, 15, 0.5);
  display: grid;
  gap: 15px;
  align-content: start;
  overflow: hidden;
  transition:
    background 280ms ease,
    transform 280ms ease,
    box-shadow 280ms ease,
    border-color 280ms ease;
}

.work::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.62), transparent 34%),
    radial-gradient(circle at 88% 12%, rgba(182, 138, 72, 0.12), transparent 30%);
}

.work:hover {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 253, 249, 0.86)),
    rgba(255, 255, 255, 0.82);
  border-color: rgba(255, 255, 255, 0.94);
  transform: translateY(-5px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    inset 0 -1px 0 rgba(22, 18, 15, 0.05),
    0 2px 8px rgba(22, 18, 15, 0.04),
    0 34px 82px -44px rgba(22, 18, 15, 0.58);
}

.work > * { position: relative; z-index: 1; }

.work__title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(2.6rem, 4.6vw, 4rem);
  line-height: 1;
  letter-spacing: -0.04em;
}

.work__kind {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.work__body {
  margin: 4px 0 0;
  color: var(--ink-soft);
  font-size: 1.02rem;
  line-height: 1.6;
  max-width: 42ch;
}

.work__link {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-self: start;
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--bordeaux);
  text-decoration: none;
  padding: 10px 12px;
  margin-left: -12px;
  border-radius: 999px;
  transition: gap 200ms ease, background 200ms ease;
}
.work__link:hover {
  gap: 12px;
  background: rgba(115, 31, 53, 0.08);
}

/* =========================================================
   FOOTER
   ========================================================= */
.foot {
  width: var(--w);
  margin: 0 auto;
  padding: 28px 0 40px;
  position: relative;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  color: var(--muted);
  text-transform: uppercase;
}
.foot::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(22, 18, 15, 0.18) 20%,
    rgba(22, 18, 15, 0.18) 80%,
    transparent 100%
  );
}
.foot p { margin: 0; }
.foot p:first-child { color: var(--ink); }

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 980px) {
  .hero {
    min-height: auto;
  }
}

@media (max-width: 760px) {
  .site-head {
    align-items: stretch;
    flex-direction: column;
  }

  .brand,
  .nav {
    width: 100%;
  }

  .nav {
    justify-content: space-between;
  }

  .works__grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .foot {
    flex-direction: column;
    gap: 10px;
  }
}

@media (max-width: 480px) {
  :root {
    --w: min(100% - 28px, 1180px);
    --w-tight: min(100% - 28px, 840px);
  }

  .site-head {
    padding-top: 14px;
  }

  .hero {
    padding-top: 92px;
  }

  .display {
    font-size: clamp(3.1rem, 17vw, 4.8rem);
  }

  .actions { flex-direction: column; align-items: stretch; }
  .button  { justify-content: space-between; width: 100%; }

  .work {
    border-radius: 26px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}
