:root {
  --paper: #fbfaf7;
  --white: #ffffff;
  --ink: #383737;
  --muted: #74716c;
  --terracotta: #d97751;
  --terracotta-dark: #bc5d3b;
  --sage: #8ca494;
  --sage-dark: #4f7466;
  --mustard: #d99a24;
  --sand: #e7d9c2;
  --line: #e8e2d9;
  --soft-sage: #eef2ed;
  --soft-orange: #fbf0e9;
  --radius: 22px;
  --shadow: 0 18px 55px rgba(67, 55, 45, 0.09);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  background: var(--paper);
  color: var(--ink);
  font-family: "Avenir Next", Avenir, "Segoe UI", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.55;
}

button, input { font: inherit; }
button { color: inherit; }
img { display: block; max-width: 100%; }
a { color: inherit; }

button:focus-visible, a:focus-visible, input:focus-visible, label:focus-within {
  outline: 3px solid rgba(217, 119, 81, 0.28);
  outline-offset: 3px;
}

.site-header {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 78px;
  padding: 10px clamp(20px, 5vw, 72px);
  border-bottom: 1px solid rgba(56, 55, 55, 0.08);
  background: rgba(251, 250, 247, 0.94);
  backdrop-filter: blur(14px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.brand img { width: 52px; height: 52px; object-fit: contain; }
.brand-name { display: flex; flex-direction: column; }
.brand-name b { font-size: 1.02rem; font-weight: 650; letter-spacing: 0.01em; }
.brand-name b i, .brand-name b em { color: var(--terracotta); font-style: normal; }
.brand-name b em { color: var(--sage); }
.brand-name small { color: var(--muted); font-size: 0.68rem; letter-spacing: 0.055em; }

.quiet-link, .back-home {
  padding: 8px 0;
  border: 0;
  border-bottom: 1px solid var(--terracotta);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font-weight: 650;
}

main { min-height: calc(100vh - 78px); }
.home-view, .workshop-view { width: min(1240px, calc(100% - 40px)); margin: 0 auto; }
.home-view { padding: clamp(42px, 7vw, 100px) 0 35px; }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(420px, 1.08fr);
  align-items: center;
  gap: clamp(40px, 7vw, 95px);
}

.overline {
  margin: 0 0 13px;
  color: var(--terracotta);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.14em;
}

h1, h2, h3, p { overflow-wrap: anywhere; }
h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(3.35rem, 7vw, 6.7rem);
  font-weight: 400;
  line-height: 0.91;
  letter-spacing: -0.055em;
}
h1 span { display: block; margin-bottom: 10px; color: var(--sage-dark); font-family: inherit; font-size: 0.26em; font-style: italic; letter-spacing: 0; }
.hero-lead { max-width: 620px; margin: 27px 0 0; color: var(--muted); font-size: 1.08rem; }

.hero-meta { display: flex; flex-wrap: wrap; gap: 20px; margin: 32px 0; }
.hero-meta span { display: flex; align-items: baseline; gap: 6px; color: var(--muted); font-size: 0.83rem; }
.hero-meta b { color: var(--ink); font-size: 1.05rem; }

.primary-button, .secondary-button {
  min-height: 48px;
  padding: 12px 22px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 750;
  transition: background 160ms ease, transform 160ms ease, border 160ms ease;
}
.primary-button { border: 1px solid var(--terracotta); background: var(--terracotta); color: white; }
.primary-button:hover { background: var(--terracotta-dark); transform: translateY(-1px); }
.secondary-button { border: 1px solid var(--line); background: white; }
.secondary-button:hover { border-color: var(--sage); }
.support-note { margin: 13px 0 0; color: var(--muted); font-size: 0.8rem; }

.hero-art { position: relative; margin: 0; }
.hero-art::before { content: ""; position: absolute; z-index: -1; top: -20px; right: -20px; width: 105px; height: 105px; border: 1px solid var(--terracotta); border-radius: 50%; }
.hero-art::after { content: ""; position: absolute; z-index: -1; bottom: 60px; left: -24px; width: 64px; height: 64px; background-image: radial-gradient(var(--sage) 1.6px, transparent 1.6px); background-size: 12px 12px; }
.hero-art img { width: 100%; aspect-ratio: 1.27; object-fit: cover; border-radius: 2px; box-shadow: var(--shadow); }
.hero-art figcaption { display: flex; justify-content: space-between; gap: 14px; padding-top: 11px; color: var(--muted); font-size: 0.76rem; }
.hero-art figcaption b { color: var(--ink); }

.mission-plan { display: grid; grid-template-columns: 0.62fr 1.38fr; gap: clamp(35px, 7vw, 90px); margin-top: clamp(75px, 10vw, 130px); padding-top: 45px; border-top: 1px solid var(--line); }
.section-intro h2 { max-width: 360px; margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2rem, 3.4vw, 3.2rem); font-weight: 400; line-height: 1.1; }
.plan-list { margin: 0; padding: 0; list-style: none; }
.plan-list li { display: grid; grid-template-columns: 54px 1fr; gap: 16px; align-items: center; padding: 15px 0; border-bottom: 1px solid var(--line); }
.plan-list li > span { color: var(--terracotta); font-family: Georgia, serif; font-size: 1.25rem; }
.plan-list div { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; }
.plan-list b { font-weight: 650; }
.plan-list small { color: var(--muted); text-align: right; }
.source-note { display: flex; justify-content: space-between; gap: 20px; margin-top: 65px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.76rem; }
.source-note a { color: var(--sage-dark); text-underline-offset: 4px; }

.workshop-view { padding: 26px 0 55px; }
.workshop-heading { display: grid; grid-template-columns: 155px 1fr 155px; align-items: center; gap: 20px; }
.workshop-title { display: flex; flex-direction: column; align-items: center; text-align: center; }
.workshop-title small { color: var(--terracotta); font-size: 0.68rem; font-weight: 800; letter-spacing: 0.14em; }
.workshop-title strong { font-family: Georgia, serif; font-size: 1.5rem; font-weight: 400; }
.time-left { color: var(--muted); font-size: 0.8rem; text-align: right; }

.progress { display: flex; gap: 7px; width: min(640px, 90%); margin: 24px auto 30px; }
.progress span { flex: 1; height: 4px; border-radius: 99px; background: var(--line); }
.progress span.done, .progress span.current { background: var(--sage); }
.progress span.current { box-shadow: 0 0 0 4px rgba(140, 164, 148, 0.13); }

.stage { min-height: 610px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); box-shadow: 0 14px 45px rgba(67, 55, 45, 0.06); }
.stage-inner { min-height: 610px; padding: clamp(30px, 6vw, 76px); }
.stage-header { max-width: 760px; margin-bottom: 38px; }
.stage-header h2 { margin: 5px 0 12px; font-family: Georgia, serif; font-size: clamp(2.35rem, 5vw, 4.5rem); font-weight: 400; line-height: 1; letter-spacing: -0.035em; }
.stage-header p { margin: 0; color: var(--muted); }

.prep-grid { display: grid; grid-template-columns: 1fr 0.82fr; gap: clamp(35px, 6vw, 85px); align-items: center; }
.material-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 24px 0 30px; padding: 0; list-style: none; }
.material-list li { display: flex; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.material-list span { display: grid; place-items: center; flex: 0 0 27px; height: 27px; border: 1px solid var(--sage); border-radius: 50%; color: var(--sage-dark); font-size: 0.75rem; }
.worksheet-preview { position: relative; }
.worksheet-preview img { width: min(100%, 430px); max-height: 465px; margin: 0 auto; object-fit: contain; border: 1px solid var(--line); box-shadow: var(--shadow); }
.worksheet-preview a { display: block; width: fit-content; margin: 15px auto 0; color: var(--sage-dark); font-size: 0.86rem; font-weight: 700; text-underline-offset: 4px; }

.art-history { display: grid; grid-template-columns: minmax(360px, 1.12fr) minmax(300px, 0.88fr); min-height: 610px; }
.art-observe { position: relative; overflow: hidden; background: #102f42; }
.art-observe img { width: 100%; height: 100%; min-height: 610px; object-fit: cover; }
.observe-overlay { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(38, 41, 39, 0.32); opacity: 0; pointer-events: none; transition: opacity 250ms ease; }
.observe-overlay.active { opacity: 1; }
.observe-overlay strong { display: grid; place-items: center; width: 116px; height: 116px; border: 1px solid rgba(255,255,255,0.75); border-radius: 50%; background: rgba(20,25,24,0.42); color: white; font-family: Georgia, serif; font-size: 2.4rem; font-weight: 400; }
.observe-button { position: absolute; right: 20px; bottom: 20px; border: 0; background: white; color: var(--ink); }
.history-copy { display: flex; flex-direction: column; justify-content: center; padding: clamp(30px, 5vw, 64px); }
.history-copy h2 { margin: 5px 0 18px; font-family: Georgia, serif; font-size: clamp(2.2rem, 4vw, 3.8rem); font-weight: 400; line-height: 1; }
.history-facts { margin: 20px 0 0; padding: 0; list-style: none; }
.history-facts li { display: grid; grid-template-columns: 30px 1fr; gap: 11px; padding: 12px 0; border-top: 1px solid var(--line); color: var(--muted); }
.history-facts b { color: var(--terracotta); font-family: Georgia, serif; font-size: 1.2rem; font-weight: 400; }

.quiz-wrap { display: grid; grid-template-columns: 0.62fr 1.38fr; gap: clamp(35px, 6vw, 80px); align-items: center; }
.quiz-progress { color: var(--terracotta); font-size: 0.78rem; font-weight: 800; letter-spacing: 0.12em; }
.quiz-side h2 { margin: 9px 0 13px; font-family: Georgia, serif; font-size: clamp(2.3rem, 4vw, 3.8rem); font-weight: 400; line-height: 1; }
.quiz-side p { color: var(--muted); }
.quiz-card { padding: clamp(25px, 4vw, 45px); border: 1px solid var(--line); border-radius: 18px; background: var(--paper); }
.quiz-card h3 { margin: 0 0 23px; font-size: 1.25rem; font-weight: 650; }
.answer-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.answer-button { min-height: 88px; padding: 15px; border: 1px solid var(--line); border-radius: 14px; background: white; cursor: pointer; font-weight: 650; }
.answer-button:hover, .answer-button.selected { border-color: var(--sage); background: var(--soft-sage); }
.answer-button.correct { border-color: var(--sage-dark); background: var(--soft-sage); color: var(--sage-dark); }
.answer-button.wrong { border-color: var(--terracotta); background: var(--soft-orange); }
.answer-button .line-sample { display: block; height: 30px; margin-bottom: 7px; }
.answer-button svg { width: 100%; height: 100%; }
.quiz-feedback { min-height: 28px; margin: 18px 0 0; color: var(--sage-dark); font-weight: 650; }
.quiz-next { margin-top: 12px; }

.create-layout { display: grid; grid-template-columns: minmax(0, 1fr) 285px; gap: clamp(35px, 6vw, 80px); align-items: center; }
.create-steps { margin: 22px 0 0; padding: 0; list-style: none; }
.create-steps li { display: grid; grid-template-columns: 40px 1fr; gap: 12px; padding: 13px 0; border-top: 1px solid var(--line); }
.create-steps span { color: var(--terracotta); font-family: Georgia, serif; font-size: 1.2rem; }
.create-steps b { display: block; font-weight: 650; }
.create-steps small { color: var(--muted); }
.timer-panel { padding: 28px; border-radius: 18px; background: var(--soft-sage); text-align: center; }
.timer-panel > small { color: var(--sage-dark); font-weight: 800; letter-spacing: 0.1em; }
.timer-display { margin: 17px 0; font-family: Georgia, serif; font-size: 3.8rem; font-variant-numeric: tabular-nums; line-height: 1; }
.timer-panel .primary-button { width: 100%; background: var(--sage-dark); border-color: var(--sage-dark); }
.timer-options { display: flex; justify-content: center; gap: 6px; margin-top: 15px; }
.timer-options button { padding: 5px 9px; border: 1px solid rgba(79,116,102,0.24); border-radius: 999px; background: transparent; color: var(--sage-dark); cursor: pointer; font-size: 0.76rem; }
.timer-options button.active { background: white; }

.upload-layout { display: grid; grid-template-columns: 0.86fr 1.14fr; gap: clamp(35px, 6vw, 75px); align-items: start; }
.upload-copy h2 { margin: 7px 0 14px; font-family: Georgia, serif; font-size: clamp(2.4rem, 4.5vw, 4.3rem); font-weight: 400; line-height: 1; }
.upload-copy > p { color: var(--muted); }
.author-rule { margin-top: 25px; padding: 17px; border-left: 3px solid var(--terracotta); background: var(--soft-orange); font-size: 0.9rem; }
.upload-panel { padding: clamp(20px, 4vw, 38px); border: 1px solid var(--line); border-radius: 18px; background: var(--paper); }
.upload-drop { display: grid; place-items: center; min-height: 240px; padding: 25px; border: 1px dashed var(--sage); border-radius: 14px; background: white; cursor: pointer; text-align: center; }
.upload-drop input { position: absolute; opacity: 0; pointer-events: none; }
.upload-drop img { display: none; max-height: 330px; object-fit: contain; }
.upload-drop.has-image span { display: none; }
.upload-drop.has-image img { display: block; }
.upload-icon { display: block; color: var(--terracotta); font-family: Georgia, serif; font-size: 2.2rem; }
.upload-drop small { display: block; margin-top: 5px; color: var(--muted); }
.choice-block { margin-top: 20px; }
.choice-block > b { display: block; margin-bottom: 9px; font-size: 0.85rem; }
.chip-row { display: flex; flex-wrap: wrap; gap: 7px; }
.chip { padding: 7px 11px; border: 1px solid var(--line); border-radius: 999px; background: white; cursor: pointer; font-size: 0.8rem; }
.chip.active { border-color: var(--sage); background: var(--soft-sage); color: var(--sage-dark); }
.generate-button { width: 100%; margin-top: 22px; }
.generate-button:disabled { cursor: not-allowed; opacity: 0.48; transform: none; }
.privacy-note { margin: 10px 0 0; color: var(--muted); font-size: 0.73rem; text-align: center; }

.ai-result { grid-column: 1 / -1; display: none; margin-top: 10px; padding-top: 36px; border-top: 1px solid var(--line); }
.ai-result.visible { display: block; }
.ai-result h3 { margin: 0 0 18px; font-family: Georgia, serif; font-size: 2rem; font-weight: 400; }
.compare-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.compare-card { margin: 0; }
.compare-card img, .compare-card canvas { width: 100%; aspect-ratio: 4 / 3; object-fit: contain; border: 1px solid var(--line); background: white; }
.compare-card figcaption { display: flex; justify-content: space-between; gap: 10px; padding-top: 8px; color: var(--muted); font-size: 0.76rem; }
.compare-card b { color: var(--ink); }
.result-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 17px; }
.demo-badge { color: var(--terracotta); }

.workshop-controls { display: grid; grid-template-columns: 140px 1fr 140px; align-items: center; gap: 14px; margin-top: 18px; }
.workshop-controls p { margin: 0; color: var(--muted); font-size: 0.78rem; text-align: center; }

.parent-dialog { width: min(700px, calc(100vw - 30px)); max-height: 90vh; padding: 0; border: 0; border-radius: 20px; background: var(--paper); box-shadow: 0 25px 80px rgba(56,55,55,0.22); }
.parent-dialog::backdrop { background: rgba(56,55,55,0.38); backdrop-filter: blur(4px); }
.parent-dialog form { padding: clamp(28px, 6vw, 58px); }
.dialog-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.dialog-top button { display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 50%; background: white; cursor: pointer; font-size: 1.25rem; }
.parent-dialog h2 { margin: 5px 0 18px; font-family: Georgia, serif; font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 400; line-height: 1.05; }
.parent-dialog > form > p { color: var(--muted); }
.parent-dialog dl { margin: 28px 0 0; }
.parent-dialog dl div { display: grid; grid-template-columns: 150px 1fr; gap: 18px; padding: 13px 0; border-top: 1px solid var(--line); }
.parent-dialog dt { color: var(--terracotta); font-weight: 700; }
.parent-dialog dd { margin: 0; color: var(--muted); }
.dialog-note { margin: 25px 0 0; padding: 14px 16px; border-radius: 12px; background: var(--soft-sage); color: var(--sage-dark) !important; font-size: 0.82rem; }

.toast { position: fixed; z-index: 100; right: 22px; bottom: 22px; max-width: min(380px, calc(100vw - 44px)); padding: 13px 17px; border-radius: 12px; background: var(--ink); color: white; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transform: translateY(12px); transition: 180ms ease; }
.toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 900px) {
  .brand-name small { display: none; }
  .hero { grid-template-columns: 1fr; }
  .hero-copy { max-width: 700px; }
  .hero-art { max-width: 760px; }
  .mission-plan { grid-template-columns: 1fr; }
  .section-intro h2 { max-width: 600px; }
  .prep-grid, .quiz-wrap, .create-layout, .upload-layout { grid-template-columns: 1fr; }
  .art-history { grid-template-columns: 1fr; }
  .art-observe img { min-height: auto; aspect-ratio: 1.27; }
  .history-copy { padding: 35px; }
  .timer-panel { max-width: 360px; width: 100%; margin: 0 auto; }
}

@media (max-width: 620px) {
  .site-header { min-height: 66px; padding: 8px 15px; }
  .brand img { width: 43px; height: 43px; }
  .brand-name b { font-size: 0.9rem; }
  .quiet-link { font-size: 0.8rem; }
  .home-view, .workshop-view { width: min(100% - 28px, 1240px); }
  .home-view { padding-top: 42px; }
  h1 { font-size: clamp(3.3rem, 17vw, 5.2rem); }
  .hero-meta { gap: 10px 17px; }
  .hero-art::before, .hero-art::after { display: none; }
  .plan-list div { align-items: flex-start; flex-direction: column; gap: 1px; }
  .plan-list small { text-align: left; }
  .source-note { flex-direction: column; gap: 5px; }
  .workshop-heading { grid-template-columns: auto 1fr auto; gap: 8px; }
  .back-home { font-size: 0.72rem; }
  .workshop-title strong { font-size: 1.08rem; }
  .workshop-title small { font-size: 0.56rem; }
  .time-left { font-size: 0.68rem; }
  .progress { width: 96%; }
  .stage { min-height: 580px; }
  .stage-inner { min-height: 580px; padding: 28px 20px; }
  .material-list, .answer-grid { grid-template-columns: 1fr; }
  .art-observe img { min-height: 360px; }
  .compare-grid { grid-template-columns: 1fr; }
  .workshop-controls { grid-template-columns: 1fr 1fr; }
  .workshop-controls p { display: none; }
  .parent-dialog dl div { grid-template-columns: 1fr; gap: 2px; }
}

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

/* Nawigacja do listy warsztatów online */
.header-links { display: flex; align-items: center; gap: clamp(14px, 3vw, 28px); }
.header-links a.quiet-link { text-decoration: none; }
@media (max-width: 520px) { .brand-name small { display: none; } .header-links { gap: 12px; } }
