/* ===== CULORI ===== */
:root {
  --paper: #EEE3D2;
  --card: #F8F0E3;
  --text: #35293F;
  --text-light: #64546C;
  --plum: #4A3B63;
  --blue: #8E93D8;
  --pink: #EC9BA6;
  --green: #8DA05A;
  --yellow: #E3A73F;
  --red: #D9573F;
  --cream: #FBF4E6;
  --wood: #B98657;
  --light: #F6C76A;
}

/* varianta de seara, daca utilizatorul are dark mode */
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #2A2235;
    --card: #352C42;
    --text: #F2E8D7;
    --text-light: #CBBBCF;
    --plum: #1D1727;
    --blue: #5D61A6;
    --pink: #C47A89;
    --green: #67793F;
    --cream: #E6D8C1;
    --wood: #7E5B3D;
  }
}

/* ===== BAZA ===== */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background-color: var(--paper);
  color: var(--text);
  font-family: "Fraunces", Georgia, serif;
  font-variation-settings: "SOFT" 100;
  font-size: 18px;
  line-height: 1.7;
}

/* textura de hartie peste toata pagina */
body::after {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url("images/grain.svg");
  opacity: 0.45;
  pointer-events: none;
}

h1, h2, h3, .button, .nav, .handwritten, figcaption, label, .word, .who {
  font-family: "Gaegu", "Comic Sans MS", sans-serif;
}

h1, h2, h3 {
  line-height: 1;
  margin: 0 0 20px;
}

h2 {
  font-size: 64px;
}

h3 {
  font-size: 28px;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 100px 24px;
}

.center {
  text-align: center;
}

.intro {
  max-width: 640px;
  color: var(--text-light);
  font-size: 20px;
}

.small {
  font-size: 16px;
  color: var(--text-light);
}

.handwritten {
  font-size: 26px;
  line-height: 1.3;
}

.big {
  font-size: 34px;
  max-width: 720px;
  margin: 70px auto;
}

/* ===== CULORI PENTRU DESENE ===== */
.plum { fill: var(--plum); }
.blue { fill: var(--blue); }
.pink { fill: var(--pink); }
.green { fill: var(--green); }
.yellow { fill: var(--yellow); }
.red { fill: var(--red); }
.cream { fill: var(--cream); }
.wood { fill: var(--wood); }
.window { fill: var(--light); }

.road {
  fill: none;
  stroke: var(--cream);
  stroke-width: 9;
  stroke-linecap: round;
}

/* ===== BUTOANE ===== */
.button {
  display: inline-block;
  background-color: var(--yellow);
  color: #35293F;
  border: 2px solid #35293F;
  /* colturi inegale = contur ca desenat de mana */
  border-radius: 255px 18px 225px 18px / 18px 225px 18px 255px;
  padding: 6px 22px;
  font-size: 24px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.button:hover {
  transform: rotate(-2deg);
}

.button.small {
  font-size: 19px;
  padding: 4px 16px;
}

/* ===== MENIU ===== */
.nav {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  padding: 10px 30px;
  background-color: var(--paper);
  font-size: 22px;
  font-weight: 700;
}

.nav a {
  color: var(--text);
  text-decoration: none;
  margin-left: 24px;
}

.nav .nav-home {
  margin-left: 0;
}

.nav svg {
  width: 22px;
  fill: var(--red);
}

/* ===== 1. HOME ===== */

h1 {
  font-size: 220px;
  line-height: 0.75;
  margin-bottom: 30px;
}

.subtitle {
  font-family: "Gaegu", sans-serif;
  font-size: 32px;
  line-height: 1.2;
  margin: 0 0 10px;
}

.hero {
  position: relative;
  min-height: 100vh;
  padding-top: 110px;
  text-align: center;
  overflow: hidden;
  /* textul sus, peisajul mereu dedesubt */
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero .button {
  margin-bottom: 40px;
}

.landscape {
  display: block;
  width: 100%;
  height: max(240px, 26.5vw); /* destul de inalt ca sa nu se taie muntii */
  margin-top: auto;
  animation: appear 1.5s ease-out;
}

/* peisajul urca usor cand se incarca pagina */
@keyframes appear {
  from { opacity: 0; transform: translateY(40px); }
  to { opacity: 1; transform: translateY(0); }
}

.doodle {
  position: absolute;
  width: 100px;
}

.flower { top: 18%; left: 9%; }
.mug { top: 26%; right: 9%; }

/* casele */
.houses {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin: 40px 0;
}

.houses figure {
  margin: 0;
  width: 300px;
}

.houses figcaption {
  font-size: 22px;
  line-height: 1.3;
}

/* casa goala: doar contur punctat */
.drawn-house rect,
.drawn-house path,
.drawn-house ellipse {
  fill: transparent;
  stroke: var(--text);
  stroke-width: 2;
  stroke-dasharray: 6 5;
  transition: fill 1s;
}

/* cand apesi "Move in", JavaScript adauga clasa .colored si se coloreaza */
.drawn-house.colored rect,
.drawn-house.colored path,
.drawn-house.colored ellipse {
  stroke: transparent;
}
.drawn-house.colored .grass { fill: var(--green); }
.drawn-house.colored .chimney { fill: var(--yellow); }
.drawn-house.colored .walls { fill: var(--cream); }
.drawn-house.colored .roof { fill: var(--red); }
.drawn-house.colored .door { fill: var(--plum); }
.drawn-house.colored .win { fill: var(--light); }

/* ===== CAMERELE ===== */
.rooms-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 30px;
  margin-top: 40px;
}

.little-house {
  width: 100%;
  max-width: 260px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

.little-house:hover {
  transform: rotate(-2deg);
}

.house-name {
  font-family: "Gaegu", sans-serif;
  font-size: 28px;
  font-weight: 700;
  margin: 10px 0 0;
}

/* textul camerei apare doar dupa ce deschizi usa */
.room-text {
  font-family: "Gaegu", sans-serif;
  font-size: 22px;
  line-height: 1.3;
  color: var(--text-light);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.6s 0.6s, visibility 0.6s 0.6s;
}

.house-item.open .room-text {
  opacity: 1;
  visibility: visible;
}

/* usa se "deschide" strangandu-se spre stanga (balamaua) */
.door {
  transform-box: fill-box;
  transform-origin: left;
  transition: transform 0.6s;
}

/* fatada dispare putin dupa usa */
.outside {
  transition: opacity 0.6s 0.5s;
}

/* clasa .open e adaugata din JavaScript */
.house-item.open .door { transform: scaleX(0); }
.house-item.open .outside { opacity: 0; }
.house-item.open .room-text { opacity: 1; }

/* ===== 2. FEEL ===== */
.cards {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 24px;
  margin-top: 40px;
}

.card {
  background-color: var(--card);
  border-radius: 32px;
  padding: 24px;
}

.card h3 {
  font-size: 26px;
}

.card svg {
  width: 100%;
  border-radius: 20px;
}

.card label {
  display: block;
  font-size: 20px;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--red);
}

.sun-patch {
  fill: var(--light);
  opacity: 0.75;
  transition: transform 0.4s;
}

.lamp-glow {
  fill: var(--light);
  opacity: 0;
  transition: opacity 0.5s;
}

.dark-overlay {
  fill: #3B2A55;
  opacity: 0;
  transition: opacity 0.5s;
}

/* seara (clasa adaugata din JavaScript) */
#room.evening .sun-patch { opacity: 0; }
#room.evening .lamp-glow { opacity: 0.5; }
#room.evening .dark-overlay { opacity: 0.4; }

/* picaturile de ploaie */
.drops {
  stroke: var(--cream);
  stroke-width: 3;
  stroke-linecap: round;
  opacity: 0;
}

.raining .drops {
  animation: rain 0.9s linear infinite;
}

@keyframes rain {
  from { transform: translateY(-10px); opacity: 1; }
  to { transform: translateY(30px); opacity: 0; }
}

#ritual-glow {
  transition: opacity 0.6s;
}

#ritual-text {
  color: var(--red);
  min-height: 34px;
}

/* poze */
.photos {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 24px;
  margin-top: 50px;
}

.photos figure {
  margin: 0;
  text-align: center;
}

.photo, .photos img {
  width: 100%;
  height: 340px;
  object-fit: cover;
  border-radius: 150px 150px 24px 24px; /* forma de fereastra cu arcada */
}

.photo1 { background: radial-gradient(circle, var(--light), var(--wood)); }
.photo2 { background: radial-gradient(circle, var(--pink), var(--blue)); }
.photo3 { background: radial-gradient(circle, var(--green), var(--plum)); }

/* ===== 3. PEOPLE ===== */
.notes {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 30px;
  margin-top: 40px;
}

.note {
  background-color: #FBF4E6;
  color: #35293F;
  padding: 24px;
  box-shadow: 0 6px 12px rgba(60, 40, 70, 0.2);
  transform: rotate(-2deg);
}

.note:nth-child(2) {
  background-color: #F7DADB;
  transform: rotate(1.5deg);
}

.note:nth-child(3) {
  background-color: #E3E6C8;
}

.who {
  font-size: 20px;
  color: #64546C;
  margin: 0;
}

.add-note {
  margin-top: 50px;
}

.add-note label {
  display: block;
  font-size: 26px;
}

.add-note input {
  width: 320px;
  max-width: 100%;
  padding: 8px 14px;
  font-size: 17px;
  border: 2px solid var(--text);
  border-radius: 16px;
  background-color: var(--card);
  color: var(--text);
}

.words {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 24px;
}

.word {
  font-size: 24px;
  font-weight: 700;
  color: var(--red);
  margin: 0;
}

.words p {
  margin-top: 0;
  color: var(--text-light);
}

/* ===== 4. DIGITAL ===== */
.browser {
  margin-top: 40px;
  background-color: var(--card);
  border: 2px solid var(--text);
  border-radius: 24px;
  overflow: hidden;
}

.browser-top {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 16px;
  background-color: var(--blue);
  border-bottom: 2px solid var(--text);
  font-family: "Gaegu", sans-serif;
  font-size: 20px;
  color: #35293F;
}

.browser-home {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background-color: var(--cream);
  cursor: pointer;
}

.browser-home svg {
  width: 22px;
  fill: var(--red);
}

/* casuta se misca atunci cand esti pierdut */
.wiggle {
  animation: wiggle 0.8s infinite;
}

@keyframes wiggle {
  0% { transform: rotate(0deg); }
  25% { transform: rotate(-12deg); }
  75% { transform: rotate(12deg); }
  100% { transform: rotate(0deg); }
}

.browser-content {
  padding: 40px;
  min-height: 180px;
}

.terminal {
  display: inline-block;
  background-color: var(--plum);
  color: var(--light);
  padding: 12px 20px;
  margin-right: 16px;
  border-radius: 14px;
  font-size: 20px;
}

.terminal-text {
  margin-top: 30px;
}

.ending {
  margin-top: 80px;
}

.huge {
  font-size: 54px;
  line-height: 1.1;
}

footer a {
  color: var(--text);
}

footer {
  text-align: center;
  padding: 30px;
  font-size: 15px;
  color: var(--text-light);
}

/* ===== PAGINA PROCESS ===== */
.nav .current {
  text-decoration: underline wavy var(--red);
}

.process-intro {
  padding-top: 140px;
}

.process-title {
  font-size: 140px;
}

/* notite pe hartie cu linii */
.notebook-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 24px;
  margin-top: 40px;
}

.notebook {
  background-color: #FBF4E6;
  color: #35293F;
  padding: 24px;
  border-radius: 8px;
  /* liniile de caiet: o linie la fiecare 30px */
  background-image: repeating-linear-gradient(transparent 0 29px, #E3D6C2 29px 30px);
  line-height: 30px;
  box-shadow: 0 6px 12px rgba(60, 40, 70, 0.15);
}

.notebook p {
  margin: 0 0 30px;
  font-size: 17px;
}

.interview-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  margin-top: 40px;
}

.interview {
  background-color: var(--card);
  border-radius: 32px;
  padding: 30px;
}

.takeaway {
  color: var(--text-light);
  font-size: 16px;
}

.mood-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 20px;
  margin: 40px 0;
}

.mood-grid figure {
  margin: 0;
  text-align: center;
}

.mood, .mood-grid img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-radius: 24px;
}

.mood1 { background: linear-gradient(var(--blue), var(--pink)); }
.mood2 { background: radial-gradient(circle, var(--light), var(--wood)); }
.mood3 { background: linear-gradient(135deg, var(--green), var(--red)); }
.mood4 { background: linear-gradient(var(--green), var(--blue)); }

.shape-row {
  display: flex;
  gap: 30px;
  flex-wrap: wrap;
  margin-bottom: 40px;
}

.shape-row svg {
  width: 90px;
}

.swatches {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.swatch {
  font-family: "Gaegu", sans-serif;
  font-size: 20px;
  line-height: 1.2;
}

.swatch span {
  display: block;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  margin-bottom: 8px;
  border: 2px solid var(--text);
}

.type-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  margin-bottom: 30px;
}

.type-big {
  font-size: 60px;
  margin: 0;
}

.serif-sample {
  font-family: "Fraunces", Georgia, serif;
}

.rules {
  margin-bottom: 40px;
}

.timeline {
  max-width: 700px;
  padding-left: 24px;
}

.timeline li {
  margin-bottom: 16px;
}

/* ===== TELEFON ===== */
@media (max-width: 800px) {
  h1 { font-size: 130px; }
  h2 { font-size: 44px; }
  .subtitle { font-size: 26px; }
  .container { padding: 70px 20px; }

  /* coloanele devin una sub alta */
  .cards, .photos, .notes, .words, .rooms-row,
  .notebook-row, .interview-row, .mood-grid, .type-row {
    grid-template-columns: 1fr;
  }

/* ecrane foarte inguste (telefoane mici): meniul tot pe un rand */
@media (max-width: 400px) {
  .nav {
    padding: 10px 12px;
    font-size: 16px;
  }

  .nav a {
    margin-left: 8px;
  }
}

  .houses {
    flex-direction: column;
    align-items: center;
  }

  .nav { padding: 10px 14px; font-size: 18px; }
  .nav a { margin-left: 10px; }
  .home-word { display: none; } /* pe telefon ramane doar iconita casei */
  .process-title { font-size: 90px; }
  .swatches { grid-template-columns: 1fr 1fr; }

  .doodle { display: none; } /* pe telefon nu e loc pentru ele */

  .big { font-size: 28px; }
  .huge { font-size: 40px; }
}

/* fara animatii pentru cine le-a dezactivat din sistem */
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

/* contur vizibil cand navighezi cu tastatura */
a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 3px dashed var(--red);
  outline-offset: 4px;
}

/* ===== VIDEO STOP MOTION ===== */
.video-box {
  margin: 60px auto 0;
  max-width: 720px;
}

.home-video {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 32px;
}

.video-box figcaption {
  font-size: 22px;
  margin-top: 10px;
}
