/* =========================================================
   css3.ro — foaie de stil comuna
   Concept: planșă tehnică / fișă de specificații pentru CSS3
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Source+Serif+4:opsz,wght@8..60,400;8..60,600&family=JetBrains+Mono:wght@400;500;700&display=swap');

:root {
  /* culori */
  --blue-deep: #0e2a47;
  --blue-panel: #123657;
  --blue-line: rgba(148, 186, 222, .16);
  --blue-line-strong: rgba(148, 186, 222, .32);
  --paper: #f4efe1;
  --paper-dim: #ece4d0;
  --paper-line: rgba(28, 37, 48, .1);
  --ink: #1c2530;
  --ink-soft: #4a5568;
  --cream: #efe7d6;
  --cream-dim: #c9d6e3;
  --accent: #d6472e;
  --accent-dark: #ad3620;
  --accent-2: #e8b339;

  /* tipografie */
  --f-sans: 'Space Grotesk', 'Segoe UI', sans-serif;
  --f-serif: 'Source Serif 4', Georgia, serif;
  --f-mono: 'JetBrains Mono', 'Courier New', monospace;

  /* ritm */
  --wrap: 1080px;
  --radius: 3px;
}

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

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

body {
  margin: 0;
  background: var(--blue-deep);
  background-image:
    linear-gradient(var(--blue-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--blue-line) 1px, transparent 1px);
  background-size: 34px 34px;
  color: var(--cream);
  font-family: var(--f-serif);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

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

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 28px;
}

h1,
h2,
h3,
h4,
.nav a,
.btn,
.tag,
code,
pre,
.demo-label {
  font-family: var(--f-sans);
}

h1,
h2,
h3,
h4 {
  color: var(--cream);
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 .5em;
}

.on-paper h1,
.on-paper h2,
.on-paper h3,
.on-paper h4 {
  color: var(--ink);
}

p {
  margin: 0 0 1.1em;
}

.on-paper p {
  color: var(--ink-soft);
}

::selection {
  background: var(--accent-2);
  color: var(--ink);
}

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

/* ---------- header / nav ---------- */

.site-header {
  border-bottom: 1px solid var(--blue-line-strong);
  background: rgba(14, 42, 71, .85);
  backdrop-filter: blur(6px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  padding-bottom: 16px;
}

.logo {
  font-family: var(--f-mono);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--cream);
  text-decoration: none;
  white-space: nowrap;
}

.logo span {
  color: var(--accent-2);
}

.logo::after {
  content: '{ }';
  margin-left: .35em;
  color: var(--cream-dim);
  font-weight: 400;
}

.nav {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
}

.nav a {
  color: var(--cream-dim);
  text-decoration: none;
  font-size: .92rem;
  font-weight: 500;
  padding: 6px 2px;
  border-bottom: 2px solid transparent;
  transition: color .15s ease, border-color .15s ease;
}

.nav a:hover {
  color: var(--cream);
}

.nav a.is-active {
  color: var(--accent-2);
  border-color: var(--accent-2);
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--blue-line-strong);
  color: var(--cream);
  padding: 7px 10px;
  font-family: var(--f-mono);
  border-radius: var(--radius);
}

@media (max-width: 720px) {
  .nav-toggle {
    display: block;
  }

  .nav {
    display: none;
    width: 100%;
    flex-direction: column;
    gap: 4px;
    padding-top: 12px;
  }

  .nav.is-open {
    display: flex;
  }

  .site-header .wrap {
    flex-wrap: wrap;
  }
}

/* ---------- hero ---------- */

.hero {
  padding: 84px 0 10px;
  position: relative;
}

.hero .wrap {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 56px;
  align-items: center;
}

@media (max-width: 860px) {
  .hero .wrap {
    grid-template-columns: 1fr;
  }
}

.eyebrow-code {
  display: inline-block;
  font-family: var(--f-mono);
  font-size: .85rem;
  color: var(--accent-2);
  background: rgba(232, 179, 57, .08);
  border: 1px solid rgba(232, 179, 57, .35);
  padding: 4px 10px;
  border-radius: var(--radius);
  margin-bottom: 22px;
}

.hero h1 {
  font-size: clamp(2.1rem, 4.4vw, 3.4rem);
  max-width: 13ch;
  margin-bottom: .38em;
}

.hero h1 .grad {
  background: linear-gradient(100deg, var(--accent-2), var(--accent) 70%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero p.lead {
  color: var(--cream-dim);
  font-size: 1.08rem;
  max-width: 46ch;
  margin-bottom: 1.6em;
}

.hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  text-decoration: none;
  font-weight: 600;
  font-size: .92rem;
  padding: 12px 20px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}

.btn-primary {
  background: var(--accent);
  color: #fff5ef;
  box-shadow: 3px 3px 0 var(--accent-dark);
}

.btn-primary:hover {
  transform: translate(-2px, -2px);
  box-shadow: 5px 5px 0 var(--accent-dark);
}

.btn-ghost {
  border-color: var(--blue-line-strong);
  color: var(--cream);
}

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

/* the live demo tile that sits in the hero */
.hero-demo {
  width: min(100%, 320px);
  aspect-ratio: 1 / 1;
  max-width: 320px;
  margin: 0 auto;
  border-radius: 22px;
  background: linear-gradient(135deg, #ffd88a, var(--accent) 55%, #7a2ea1);
  box-shadow: 0 18px 0 -6px rgba(0, 0, 0, .18), 0 26px 40px rgba(0, 0, 0, .35);
  position: relative;
  transition: border-radius .5s cubic-bezier(.65, 0, .35, 1), transform .5s ease;
}

.hero-demo:hover {
  border-radius: 50%;
  transform: rotate(8deg) scale(1.03);
}

.hero-demo::after {
  content: 'border-radius, gradient, box-shadow, transition — hover cu mouse-ul';
  position: absolute;
  bottom: -34px;
  left: 0;
  right: 0;
  text-align: center;
  font-family: var(--f-mono);
  font-size: .72rem;
  color: var(--cream-dim);
}

/* ---------- tutorial page head (blue, above the paper) ---------- */

.page-head {
  padding: 52px 0 44px;
}

.page-head .module-seq {
  display: block;
  font-family: var(--f-mono);
  font-size: .8rem;
  color: var(--accent-2);
  margin-bottom: 14px;
}

.page-head h1 {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  max-width: 22ch;
}

.page-head p.lead {
  color: var(--cream-dim);
  font-size: 1.02rem;
  margin-bottom: 20px;
}
 
.page-head p + p {
  color: var(--cream-dim);
  font-size: .98rem;
  margin-top: 12px;
}

/* ---------- section scaffolding ---------- */

section {
  padding: 64px 0;
}

.section-head {
  max-width: 60ch;
  margin-bottom: 40px;
}

.section-head h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
}

.section-head p {
  color: var(--cream-dim);
}

.on-paper .section-head p {
  color: var(--ink-soft);
}

/* ---------- module grid (homepage) ---------- */

.module-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

@media (max-width: 860px) {
  .module-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 560px) {
  .module-grid {
    grid-template-columns: 1fr;
  }

  .hero-demo {
    width: min(100%, 260px);
    margin-left: 20px;
  }
}

.module-card {
  background: var(--paper);
  color: var(--ink);
  text-decoration: none;
  padding: 22px 20px 20px;
  position: relative;
  border: 1px solid var(--paper-line);
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 190px;
}

.module-card::before,
.module-card::after,
.corner::before,
.corner::after {
  content: '';
  position: absolute;
  width: 12px;
  height: 12px;
  border-color: var(--accent);
  border-style: solid;
  opacity: .65;
}

.module-card::before {
  top: -1px;
  left: -1px;
  border-width: 2px 0 0 2px;
}

.module-card::after {
  bottom: -1px;
  right: -1px;
  border-width: 0 2px 2px 0;
}

.module-card .m-index {
  font-family: var(--f-mono);
  font-size: .78rem;
  color: var(--accent-dark);
}

.module-card h3 {
  color: var(--ink);
  font-size: 1.14rem;
  margin-bottom: 0;
}

.module-card p {
  color: var(--ink-soft);
  font-size: .93rem;
  margin: 0;
  flex-grow: 1;
}

.module-card .go {
  font-family: var(--f-mono);
  font-size: .82rem;
  color: var(--accent-dark);
  font-weight: 700;
  border-top: 1px dashed var(--paper-line);
  padding-top: 12px;
}

.module-card:hover {
  background: var(--paper-dim);
  transform: translateY(-3px);
  box-shadow: 0 14px 26px rgba(10, 30, 51, .12);
}

.module-card:hover .go {
  color: var(--accent);
}

.module-card {
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}

/* mini live swatches inside module cards */
.swatch {
  height: 46px;
  border: 1px solid var(--paper-line);
}

.swatch-selectors {
  background: repeating-linear-gradient(45deg, #dfe6ee, #dfe6ee 6px, #cdd8e3 6px, #cdd8e3 12px);
}

.swatch-boxmodel {
  background: var(--paper-dim);
  border-radius: 12px;
  box-shadow: inset 0 0 0 6px #e3d8bb, inset 0 0 0 12px var(--paper);
}

.swatch-backgrounds {
  background: radial-gradient(circle at 30% 30%, #ffe3a8, transparent 60%), linear-gradient(120deg, #6ea8d8, #7a2ea1);
}

.swatch-text {
  background: var(--paper-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--f-serif);
  font-size: 1.3rem;
  color: var(--ink);
  text-shadow: 2px 2px 0 rgba(214, 71, 46, .35);
}

.swatch-layout {
  background: var(--paper-dim);
  display: flex;
  gap: 4px;
  padding: 8px;
}

.swatch-layout span {
  flex: 1;
  background: #cdd8e3;
}

.swatch-layout span:nth-child(2) {
  flex: 2;
  background: var(--accent-2);
}

.swatch-anim {
  background: var(--paper-dim);
  display: flex;
  align-items: center;
  justify-content: center;
}

.swatch-anim i {
  width: 16px;
  height: 16px;
  background: var(--accent);
  display: block;
  animation: bob 1.6s ease-in-out infinite;
}

@keyframes bob {

  0%,
  100% {
    transform: translateY(0) rotate(0);
  }

  50% {
    transform: translateY(-8px) rotate(45deg);
  }
}

/* ---------- content panels on tutorial pages ---------- */

.on-paper {
  background: var(--paper);
  color: var(--ink);
}

.spec {
  border: 1px solid var(--paper-line);
  padding: 26px 26px 22px;
  margin-bottom: 26px;
  position: relative;
}

.spec::before {
  content: '';
  position: absolute;
  top: -1px;
  left: -1px;
  width: 12px;
  height: 12px;
  border: 2px solid var(--accent);
  border-right: 0;
  border-bottom: 0;
  opacity: .65;
}

.spec::after {
  content: '';
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 12px;
  height: 12px;
  border: 2px solid var(--accent);
  border-left: 0;
  border-top: 0;
  opacity: .65;
}

.spec h3 {
  color: var(--ink);
  font-size: 1.2rem;
}

.spec .tag {
  font-family: var(--f-mono);
  font-size: .74rem;
  color: var(--accent-dark);
  border: 1px solid rgba(214, 71, 46, .4);
  padding: 2px 7px;
  border-radius: var(--radius);
  margin-bottom: 10px;
  display: inline-block;
}

.spec-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  align-items: start;
  margin-top: 14px;
}

.spec-body > * {
  min-width: 0;
  max-width: 100%;
}

@media (max-width: 760px) {
  .spec-body {
    grid-template-columns: 1fr;
  }

  .spec-body > * {
    width: 100%;
  }
}

pre {
  background: #0a1e33;
  color: #dce6f0;
  padding: 16px 18px;
  overflow-x: auto;
  font-family: var(--f-mono);
  font-size: .84rem;
  line-height: 1.55;
  margin: 0;
  border-left: 3px solid var(--accent-2);
}

code {
  font-family: var(--f-mono);
}

.on-paper :not(pre)>code {
  background: rgba(28, 37, 48, .07);
  padding: .12em .4em;
  font-size: .88em;
  border-radius: 3px;
}

.demo-label {
  font-size: .72rem;
  text-transform: none;
  color: var(--ink-soft);
  margin-bottom: 8px;
  font-weight: 500;
}

.demo-box {
  border: 1px dashed var(--paper-line);
  background: var(--paper-dim);
  padding: 22px;
  min-height: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow-x: hidden;
}

.demo-box > * {
  max-width: 100%;
  min-width: 0;
}

.demo-box > div[style*="display:flex"],
.demo-box > [style*="display:flex"] {
  flex-wrap: wrap;
  justify-content: center;
  row-gap: 12px;
}

.spec p {
  color: var(--ink);
  font-size: .95rem;
  line-height: 1.65;
  margin-bottom: 12px;
}

.spec-details {
  margin-top: 16px;
  padding: 14px 16px;
  background: var(--paper-dim);
  border-left: 3px solid var(--accent);
  font-size: .88rem;
  color: var(--ink-soft);
  line-height: 1.65;
}

.spec-details strong {
  color: var(--ink);
}

.spec-details ul {
  margin: 8px 0 0 18px;
  padding: 0;
}

.spec-details li {
  margin-bottom: 6px;
}

/* small reusable demo pieces used across tutorial pages */
.d-btn {
  background: var(--accent);
  color: #fff5ef;
  border: none;
  padding: 10px 18px;
  font-family: var(--f-sans);
  font-weight: 600;
  cursor: pointer;
}

.d-chip {
  padding: 6px 14px;
  background: #e7ddc4;
  font-family: var(--f-mono);
  font-size: .8rem;
}

/* ---------- module footer nav (prev/next) ---------- */

.module-pager {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 28px 0 8px;
  border-top: 1px solid var(--paper-line);
  margin-top: 20px;
  flex-wrap: wrap;
}

.pager-link {
  text-decoration: none;
  color: var(--ink);
  max-width: 45%;
}

.pager-link .k {
  display: block;
  font-family: var(--f-mono);
  font-size: .72rem;
  color: var(--ink-soft);
  margin-bottom: 4px;
}

.pager-link .t {
  font-weight: 600;
}

.pager-link:hover .t {
  color: var(--accent);
}

.pager-link.next {
  text-align: right;
  margin-left: auto;
}

/* ---------- footer ---------- */

.site-footer {
  border-top: 1px solid var(--blue-line-strong);
  padding: 40px 0 30px;
}

.site-footer .wrap {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  flex-wrap: wrap;
}

.site-footer p {
  color: var(--cream-dim);
  font-size: .85rem;
  margin: 0;
}

.footer-ruler {
  opacity: .55;
}

/* ---------- table of contents (in-page nav) ---------- */

.toc {
  background: var(--paper-dim);
  border: 1px solid var(--paper-line);
  padding: 20px 24px;
  margin-bottom: 30px;
  position: relative;
}

.toc::before {
  content: '';
  position: absolute;
  top: -1px;
  left: -1px;
  width: 12px;
  height: 12px;
  border: 2px solid var(--accent-2);
  border-right: 0;
  border-bottom: 0;
  opacity: .65;
}

.toc::after {
  content: '';
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 12px;
  height: 12px;
  border: 2px solid var(--accent-2);
  border-left: 0;
  border-top: 0;
  opacity: .65;
}

.toc-title {
  font-family: var(--f-mono);
  font-size: .76rem;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin: 0 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.toc-title::before {
  content: '≡';
  font-size: 1.1rem;
  color: var(--accent-2);
}

.toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
}

.toc-list li {
  font-family: var(--f-sans);
  font-size: .88rem;
}

.toc-list li::before {
  content: '→ ';
  color: var(--accent);
  font-family: var(--f-mono);
  font-weight: 700;
}

.toc-list a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px dashed var(--paper-line);
  transition: color .15s ease, border-color .15s ease;
}

.toc-list a:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* ---------- adsense placeholder ---------- */

.ad-placeholder {
  border: 2px dashed rgba(148, 186, 222, .3);
  background: rgba(14, 42, 71, .04);
  padding: 22px;
  text-align: center;
  margin-bottom: 30px;
  position: relative;
}

.on-paper .ad-placeholder {
  border-color: var(--paper-line);
  background: rgba(28, 37, 48, .03);
}

.ad-placeholder-label {
  font-family: var(--f-mono);
  font-size: .7rem;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: .1em;
  opacity: .6;
}

.ad-placeholder-box {
  width: 100%;
  max-width: 728px;
  height: 90px;
  margin: 10px auto 0;
  background:
    repeating-linear-gradient(45deg,
      transparent,
      transparent 10px,
      rgba(148, 186, 222, .06) 10px,
      rgba(148, 186, 222, .06) 20px);
  border: 1px solid rgba(148, 186, 222, .15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--f-mono);
  font-size: .78rem;
  color: var(--ink-soft);
  opacity: .45;
}

/* ---------- responsive ---------- */

@media (max-width: 560px) {
  .wrap {
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
  }

  .hero {
    padding: 56px 0 44px;
  }

  .hero .wrap,
  .page-head .wrap {
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
  }

  section {
    padding: 44px 0;
  }

  .spec {
    padding: 20px 14px;
  }

  .spec-body pre,
  .spec-body pre code {
    white-space: pre-wrap;
    word-break: break-word;
  }

  .demo-box {
    padding: 14px 10px;
    width: 100%;
    max-width: 100%;
  }

  .demo-box > * {
    width: 100%;
    max-width: 100%;
  }

  .demo-box > div[style*="display:flex"],
  .demo-box > [style*="display:flex"] {
    width: auto;
    max-width: 100%;
    flex-wrap: wrap;
  }

  .toc-list {
    flex-direction: column;
    gap: 6px;
  }

  .ad-placeholder-box {
    height: 60px;
  }
}