/* ============================================================
   Noa Sofia - noasofia.com  V1
   Design system + layout
   ============================================================ */

:root {
  /* Brand palette (from brief) */
  --cream:    #eeede7;
  --blue:     #303ebf;   /* Noa Blue */
  --night:    #081426;   /* Night Blue */
  --teal:     #088384;
  --lavender: #bbbeff;
  --sky:      #a1cfdb;

  --ink: var(--night);
  --paper: var(--cream);

  --sans: "Helvetica Neue", "Inter", Helvetica, Arial, sans-serif;
  --pixel: "VT323", "Perfect DOS VGA 437", ui-monospace, monospace;

  --maxw: 1180px;
  --header-h: 64px;
  --shadow-pop: 0 5px 0 0 var(--night);
  --ease: cubic-bezier(.22,.61,.36,1);
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background-color: var(--cream);
  /* faint paper grain */
  background-image: radial-gradient(rgba(8,20,38,.025) 1px, transparent 1px);
  background-size: 4px 4px;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }
a { color: var(--blue); text-decoration: none; }
[hidden] { display: none !important; }

/* ---------- Shared bits ---------- */
.pixel, .lang-gate__kicker, .loader__text, .site-footer__pixel,
.view__note, .about__tags, .lang-btn__code {
  font-family: var(--pixel);
  letter-spacing: .04em;
}

.view__title {
  font-weight: 900;
  font-size: clamp(1.8rem, 4.5vw, 3rem);
  letter-spacing: -.02em;
  color: var(--blue);
  margin: 0;
  line-height: .95;
}

/* Pills / buttons */
.pill {
  display: inline-block;
  font-family: var(--sans);
  font-weight: 700;
  font-size: .95rem;
  color: var(--night);
  background: var(--cream);
  border: 2.5px solid var(--night);
  border-radius: 100px;
  padding: 12px 26px;
  cursor: pointer;
  box-shadow: var(--shadow-pop);
  transition: transform .12s var(--ease), background .15s, color .15s;
  white-space: nowrap;
}
.pill:hover { background: var(--lavender); transform: translateY(-2px); }
.pill:active { transform: translateY(3px); box-shadow: 0 0 0 0 var(--night); }
.pill--accent { background: var(--blue); color: var(--cream); }
.pill--accent:hover { background: var(--night); color: var(--cream); }

/* ============================================================
   SECTION 0 - LANGUAGE GATE
   ============================================================ */
.lang-gate {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center;
  background: var(--cream);
  background-image: radial-gradient(rgba(8,20,38,.03) 1px, transparent 1px);
  background-size: 4px 4px;
  padding: 24px;
  transition: opacity .5s var(--ease), visibility .5s;
}
.lang-gate.is-hiding { opacity: 0; visibility: hidden; }
.lang-gate__inner { text-align: center; max-width: 560px; }
.lang-gate__logo { width: 120px; margin: 0 auto 22px; animation: floaty 5s ease-in-out infinite; }
.lang-gate__kicker { color: var(--blue); font-size: 1.15rem; margin: 0 0 8px; }
.lang-gate__title {
  font-weight: 900; letter-spacing: -.02em; color: var(--night);
  font-size: clamp(1.6rem, 5vw, 2.6rem); line-height: 1; margin: 0 0 30px;
}
.lang-gate__title span {
  display: block; color: var(--blue); font-weight: 600;
  font-size: .55em; margin-top: 6px; font-style: italic;
}
.lang-gate__choices { display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; }
.lang-btn {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  width: 150px; padding: 22px 0;
  background: var(--cream); color: var(--night);
  border: 3px solid var(--night); border-radius: 14px;
  cursor: pointer; box-shadow: var(--shadow-pop);
  transition: transform .12s var(--ease), background .15s, color .15s;
}
.lang-btn:hover { background: var(--blue); color: var(--cream); transform: translateY(-2px); }
.lang-btn:nth-child(2):hover { background: var(--teal); }
.lang-btn__code { font-size: 2.4rem; line-height: 1; }
.lang-btn__name { font-family: var(--sans); font-weight: 700; font-size: .9rem; }

/* ============================================================
   SECTION 1 - LOADER
   ============================================================ */
.loader {
  position: fixed; inset: 0; z-index: 90;
  display: grid; place-items: center;
  background: var(--cream);
  transition: opacity .55s var(--ease), visibility .55s;
}
.loader.is-hiding { opacity: 0; visibility: hidden; }
.loader__inner { text-align: center; }
.loader__logo {
  width: 140px; margin: 0 auto 18px;
  animation: logoIn .9s var(--ease) both, floaty 4s ease-in-out 1s infinite;
}
.loader__text { color: var(--blue); font-size: 1.5rem; margin: 0; }
.loader__dots::after { content: ""; animation: dots 1.4s steps(4,end) infinite; }

@keyframes logoIn { from { opacity: 0; transform: scale(.7); } to { opacity: 1; transform: scale(1); } }
@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }
@keyframes dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }

/* ============================================================
   APP / HEADER
   ============================================================ */
.app { opacity: 0; transition: opacity .5s var(--ease); }
.app.is-revealed { opacity: 1; }

.site-header {
  position: sticky; top: 0; z-index: 40;
  height: var(--header-h);
  display: flex; align-items: center; gap: 18px;
  padding: 0 clamp(16px, 4vw, 40px);
  background: rgba(238,237,231,.88);
  backdrop-filter: blur(8px);
  border-bottom: 2px solid var(--night);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand__mark { width: 36px; }
.brand__word { font-weight: 900; letter-spacing: -.03em; color: var(--night); font-size: 1.25rem; }
.site-nav { display: flex; gap: 22px; margin-left: auto; }
.site-nav a {
  font-weight: 600; color: var(--night); font-size: .95rem;
  padding: 4px 2px; border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s;
}
.site-nav a:hover { color: var(--blue); }
.site-nav a.is-active { color: var(--blue); }

.lang-switch { display: flex; align-items: center; gap: 6px; font-family: var(--sans); font-weight: 700; font-size: .9rem; letter-spacing: .04em; }
.lang-switch button {
  background: none; border: none; cursor: pointer; padding: 2px 4px;
  font: inherit; color: var(--night); opacity: .5;
}
.lang-switch button.is-active { opacity: 1; color: var(--blue); }
.lang-switch span { opacity: .4; }

.nav-toggle { display: none; }

/* ============================================================
   VIEWS
   ============================================================ */
main { min-height: calc(100vh - var(--header-h)); }
.view { animation: viewIn .4s var(--ease) both; }
@keyframes viewIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.view--gallery, .view--about, .view--contact, .view--grid, .view--paintings { padding: clamp(28px, 5vw, 56px) clamp(16px, 4vw, 40px) 80px; }
.view__head {
  max-width: var(--maxw); margin: 0 auto 26px;
  display: flex; align-items: flex-end; justify-content: space-between; gap: 16px;
  border-bottom: 2px solid var(--night); padding-bottom: 14px;
}
.view__note { font-size: 1.1rem; color: var(--teal); margin: 0; }

/* ---------- HOME ---------- */
/* Homepage: violet (lavender) → cream gradient, with the dot texture over it */
.view--home {
  display: grid; place-items: center;
  min-height: calc(100vh - var(--header-h)); padding: 40px 20px;
  background-image:
    radial-gradient(rgba(8,20,38,.025) 1px, transparent 1px),
    linear-gradient(180deg, var(--lavender) 0%, var(--cream) 72%);
  background-size: 4px 4px, 100% 100%;
}
.home { text-align: center; max-width: 880px; }
.home__logo { width: clamp(120px, 22vw, 190px); margin: 0 auto 10px; animation: floaty 5s ease-in-out infinite; }
.home__name {
  font-weight: 900; letter-spacing: -.04em; color: var(--blue);
  font-size: clamp(3.2rem, 12vw, 7rem); line-height: .9; margin: 0;
}
.home__tagline { font-family: var(--pixel); font-size: clamp(1.05rem, 2.4vw, 1.5rem); color: var(--night); margin: 12px 0 34px; }
.home__nav { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; }

/* ---------- GALLERY ---------- */
.gallery { max-width: var(--maxw); margin: 0 auto; display: flex; flex-direction: column; gap: clamp(13.5px, 2.25vw, 25.5px); }
.gallery__item {
  margin: 0; cursor: zoom-in; position: relative;
  border: 2px solid var(--night);
  background: var(--cream);
  box-shadow: 5px 6px 0 -1px rgba(8,20,38,.18);
  overflow: hidden;
  transition: transform .15s var(--ease);
}
.gallery__item:hover { transform: translateY(-3px); }
.gallery__item img, .gallery__item video { width: 100%; height: auto; display: block; }
.gallery__num {
  position: absolute; top: 0; left: 0;
  font-family: var(--pixel); font-size: .72rem; line-height: 1;
  background: var(--night); color: var(--cream);
  padding: 3px 6px 2px;
}
.gallery__empty { text-align: center; font-family: var(--pixel); color: var(--teal); font-size: 1.2rem; padding: 40px; }

/* ---------- ILLUSTRATION grid (digital) ---------- */
.grid { max-width: var(--maxw); margin: 0 auto; columns: 3 300px; column-gap: clamp(12px, 2vw, 20px); }
.grid__item {
  break-inside: avoid; margin: 0 0 clamp(12px, 2vw, 20px); cursor: zoom-in;
  border: 2px solid var(--night); background: var(--cream); box-shadow: 0 4px 0 0 var(--night);
  overflow: hidden; transition: transform .15s var(--ease);
}
.grid__item:hover { transform: translateY(-3px); }
.grid__item img { width: 100%; display: block; }

/* ---------- PAINTINGS ---------- */
.paintings { max-width: var(--maxw); margin: 0 auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: clamp(20px, 3vw, 36px); }
.painting { margin: 0; cursor: zoom-in; }
.painting img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; display: block; border: 2px solid var(--night); background: var(--cream); box-shadow: 0 4px 0 0 var(--night); transition: transform .15s var(--ease); }
.painting:hover img { transform: translateY(-3px); }
.painting__cap { display: flex; flex-direction: column; gap: 2px; padding: 12px 2px 0; }
.painting__title { font-weight: 800; color: var(--night); font-size: 1.05rem; }
.painting__dims { font-family: var(--pixel); font-size: 1.05rem; color: var(--teal); line-height: 1; }
.painting__medium { font-size: .88rem; color: var(--night); opacity: .75; }

/* ---------- ABOUT ---------- */
.about { max-width: 885px; margin: 0 auto; }
.about .view__title { margin-bottom: 22px; }
.about__body { max-width: 100%; }
.about__body p { margin: 0 0 1.1em; font-size: 1.08rem; }
.about__tags { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 26px 0; }
.about__tags li {
  font-size: 1.05rem; color: var(--night);
  border: 2px solid var(--night); border-radius: 100px; padding: 2px 14px 1px; background: var(--sky);
}

/* ---------- ABOUT carousel (auto-scrolling marquee of cover-cropped tiles) ---------- */
.carousel { max-width: var(--maxw); margin: 0 auto 34px; overflow: hidden; border: 2px solid var(--night); border-radius: 14px; background: var(--cream); }
.carousel__viewport { overflow: hidden; }
.carousel__track { display: flex; width: max-content; animation: marquee 55s linear infinite; }
.carousel:hover .carousel__track { animation-play-state: paused; }
.carousel__slide { flex: 0 0 auto; width: clamp(200px, 22vw, 280px); height: clamp(260px, 38vh, 360px); }
.carousel__slide img { width: 100%; height: 100%; object-fit: cover; display: block; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) {
  .carousel { overflow-x: auto; }
  .carousel__track { animation: none; transform: none; }
}

/* ---------- CONTACT ---------- */
.contact { max-width: 720px; margin: 0 auto; }
.contact .view__title { margin-bottom: 10px; }
.contact__tagline { font-style: italic; font-size: 1.15rem; color: var(--ink); margin: 0 0 26px; }
.contact__form { display: grid; gap: 16px; }
.contact__form label { display: grid; gap: 6px; font-weight: 600; }
.contact__form label span { font-family: var(--pixel); font-size: 1.05rem; color: var(--night); font-weight: 400; }
.contact__form input, .contact__form select, .contact__form textarea {
  font: inherit; padding: 11px 14px;
  background: #fff; color: var(--night);
  border: 2px solid var(--night); border-radius: 8px;
}
.contact__form input:focus, .contact__form select:focus, .contact__form textarea:focus {
  outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--lavender);
}
.contact__form button { justify-self: start; margin-top: 4px; }
.contact__status { font-family: var(--pixel); font-size: 1.1rem; margin: 0; }
.contact__status.is-ok { color: var(--teal); }
.contact__status.is-err { color: #b3261e; }
.contact__socials {
  list-style: none; display: flex; flex-wrap: wrap; gap: 10px 22px;
  padding: 24px 0 0; margin: 28px 0 0; border-top: 2px solid var(--night);
}
.contact__socials a { font-weight: 700; color: var(--night); border-bottom: 2px solid transparent; }
.contact__socials a:hover { color: var(--blue); border-color: var(--blue); }

/* ---------- FOOTER ---------- */
.site-footer {
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  padding: 26px clamp(16px,4vw,40px); border-top: 2px solid var(--night);
  font-size: .9rem; text-align: center;
}
.footer-socials {
  list-style: none; display: flex; flex-wrap: wrap; gap: 10px 22px; justify-content: center;
  padding: 0; margin: 0;
}
.footer-socials a { font-weight: 700; color: var(--night); border-bottom: 2px solid transparent; }
.footer-socials a:hover { color: var(--blue); border-color: var(--blue); }
.site-footer__meta { display: flex; flex-wrap: wrap; gap: 6px 18px; justify-content: center; align-items: center; }
.site-footer__pixel { font-size: 1.05rem; color: var(--teal); }

/* ============================================================
   LIGHTBOX
   ============================================================ */
.lightbox {
  position: fixed; inset: 0; z-index: 120;
  display: grid; place-items: center;
  background: rgba(8,20,38,.94);
  padding: 24px;
}
.lightbox__stage { max-width: 94vw; max-height: 90vh; }
.lightbox__stage img, .lightbox__stage video { max-width: 94vw; max-height: 90vh; width: auto; height: auto; border: 2px solid var(--cream); }
.lightbox__close, .lightbox__nav {
  position: absolute; background: none; border: none; color: var(--cream);
  cursor: pointer; font-family: var(--sans); line-height: 1;
}
.lightbox__close { top: 18px; right: 24px; font-size: 2.6rem; }
.lightbox__nav { top: 50%; transform: translateY(-50%); font-size: 4rem; padding: 0 18px; opacity: .7; }
.lightbox__nav:hover { opacity: 1; }
.lightbox__nav--prev { left: 6px; }
.lightbox__nav--next { right: 6px; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 760px) {
  .nav-toggle {
    display: flex; flex-direction: column; gap: 5px; margin-left: auto;
    background: none; border: none; cursor: pointer; padding: 6px;
  }
  .nav-toggle span { width: 26px; height: 2.5px; background: var(--night); transition: transform .2s, opacity .2s; }
  .site-header { gap: 10px; }
  .site-nav {
    position: absolute; top: var(--header-h); left: 0; right: 0;
    flex-direction: column; gap: 0; margin: 0;
    background: var(--cream); border-bottom: 2px solid var(--night);
    max-height: 0; overflow: hidden; transition: max-height .28s var(--ease);
  }
  .site-nav.is-open { max-height: 560px; }
  .site-nav a { padding: 14px 24px; border-bottom: 1px solid rgba(8,20,38,.12); }
  .lang-switch { order: 3; }
  .gallery__num { display: none; }
  .carousel__btn { display: none; }
  .lightbox__nav { font-size: 2.6rem; }
}

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