/* Derrô Ateliê — catálogo público
   Cores da marca: algodão cru, marrom de corda tingida, caramelo do logo. */
:root {
  --ground: #f5efe6;
  --linen: #ebe0d1;
  --ink: #2e2119;
  --ink-soft: #5b4637;
  --field: #2e2119;
  --on-field: #f5efe6;
  --on-field-soft: #d9c9b6;
  --rope: #b0672f;
  --rope-dark: #8e4f20;
  --on-rope: #fffaf3;
  --display: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --text: "Nunito Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --m: clamp(20px, 4vw, 56px);          /* margem externa, igual dos dois lados */
  --gap: clamp(16px, 2vw, 32px);
  --section: clamp(96px, 13vw, 200px);  /* distância entre seções */
  --ease: cubic-bezier(.2, .7, .2, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0; background: var(--ground); color: var(--ink);
  font: 400 18px/1.55 var(--text); -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; margin: 0; letter-spacing: -0.02em; line-height: 1; }
p { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--rope); outline-offset: 3px; }
::selection { background: var(--rope); color: var(--on-rope); }

.skip { position: absolute; left: var(--m); top: -60px; background: var(--ink); color: var(--ground); padding: 10px 14px; z-index: 30; }
.skip:focus { top: 12px; }

/* ---------- Botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 22px;
  background: var(--rope); color: var(--on-rope); text-decoration: none; font-weight: 700; font-size: 16px;
  border: 0; border-radius: 0; cursor: pointer; transition: background .2s var(--ease), transform .2s var(--ease);
}
.btn:hover { background: var(--rope-dark); }
.btn:active { transform: translateY(1px) scale(.98); }
.btn.big { min-height: 58px; padding: 0 30px; font-size: 18px; }
.btn.outline { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 2px var(--ink); }
.btn.outline:hover { background: var(--ink); color: var(--ground); }
.btn.light { background: var(--ground); color: var(--ink); }
.btn.light:hover { background: var(--linen); }
.link { font-weight: 700; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 5px; text-decoration-color: var(--rope); transition: color .2s; }
.link:hover { color: var(--rope-dark); }

/* ---------- Barra ---------- */
.bar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: clamp(16px, 3vw, 40px);
  padding: 12px var(--m); background: var(--ground);
}
.wordmark { display: flex; align-items: center; gap: 12px; text-decoration: none; margin-right: auto; }
.wordmark img { width: 44px; height: 44px; border-radius: 50%; }
.wordmark span { font-family: var(--display); font-size: 26px; font-weight: 600; letter-spacing: -0.01em; }
.bar nav { display: flex; gap: clamp(16px, 2.4vw, 36px); }
.bar nav a { position: relative; text-decoration: none; font-weight: 600; font-size: 16px; padding: 8px 0; }
.bar nav a::after { content: ""; position: absolute; left: 0; right: 0; bottom: 2px; height: 2px; background: var(--rope); transform: scaleX(0); transform-origin: left; transition: transform .25s var(--ease); }
.bar nav a:hover::after, .bar nav a:focus-visible::after { transform: scaleX(1); }
@media (max-width: 760px) { .bar nav { display: none; } .wordmark span { font-size: 22px; } }

/* ---------- Abertura ---------- */
.hero {
  display: grid; grid-template-columns: repeat(12, 1fr); gap: var(--gap); align-items: end;
  padding: clamp(24px, 4vw, 56px) var(--m) 0; min-height: calc(100svh - 68px);
}
.hero-text { grid-column: 1 / span 6; padding-bottom: clamp(24px, 5vw, 72px); align-self: center; }
.hero h1 { font-size: clamp(52px, 6.6vw, 112px); line-height: .95; letter-spacing: -0.035em; max-width: 9.5em; }
.lead { font-size: clamp(19px, 1.5vw, 23px); margin-top: 36px; max-width: 30em; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 18px 28px; margin-top: 36px; }
.tag {
  display: inline-block; margin-top: 44px; padding: 14px 18px 14px 22px; background: var(--linen); font-size: 16px; max-width: 30em;
  clip-path: polygon(14px 0, 100% 0, 100% 100%, 14px 100%, 0 50%);
}
.tag b { font-weight: 700; }
.hero-media { grid-column: 7 / -1; margin: 0; align-self: stretch; display: flex; flex-direction: column; }
.hero-media .frame { height: clamp(420px, calc(100svh - 170px), 900px); overflow: hidden; background: var(--linen); }
.hero-media img { width: 100%; height: 100%; object-fit: cover; animation: drift 24s ease-in-out infinite alternate; }
figcaption { font-size: 15px; color: var(--ink-soft); margin-top: 10px; }
@keyframes drift { from { transform: scale(1.02); } to { transform: scale(1.1) translate(-1.5%, -1%); } }
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; min-height: 0; }
  .hero-text, .hero-media { grid-column: 1 / -1; }
  .hero-media .frame { height: auto; aspect-ratio: 4 / 5; }
}

/* ---------- Corda desenrolada ---------- */
.unroll {
  margin-top: var(--section); background: var(--field); color: var(--on-field);
  display: grid; grid-template-columns: repeat(12, 1fr); gap: var(--gap); align-items: center;
  padding: clamp(72px, 9vw, 140px) var(--m);
}
.unroll h2 { font-size: clamp(40px, 4.6vw, 76px); max-width: 10em; }
.unroll-text { grid-column: 1 / span 5; }
.statement { font-family: var(--display); font-size: clamp(24px, 2.3vw, 36px); line-height: 1.18; letter-spacing: -0.01em; max-width: 20em; }
.unroll .statement { margin-top: 32px; min-height: 3.6em; color: var(--on-field); }
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 36px; }
.chip {
  min-height: 44px; padding: 0 18px; border: 0; border-radius: 999px; cursor: pointer; font: 600 16px var(--text);
  background: #46342a; color: var(--on-field); transition: background .2s var(--ease), transform .15s var(--ease);
}
.chip:hover { background: #5a4436; }
.chip:active { transform: scale(.97); }
.chip[aria-pressed="true"] { background: var(--rope); color: var(--on-rope); }
.unroll-figure { grid-column: 6 / -1; margin: 0; position: relative; }
.meters { min-height: .8em; font-family: var(--display); font-weight: 600; font-size: clamp(88px, 12vw, 200px); line-height: .8; letter-spacing: -0.04em; color: var(--rope); font-variant-numeric: lining-nums; }
.meters small { font-size: .35em; letter-spacing: 0; margin-left: .15em; color: var(--on-field-soft); }
#rope { width: 100%; height: auto; margin-top: 12px; overflow: visible; }
#rope-track { stroke: #46342a; stroke-width: 10; stroke-linecap: round; }
#rope-path { stroke: var(--rope); stroke-width: 10; stroke-linecap: round; transition: stroke-dashoffset 1.6s var(--ease); }
#rope-tassel line { stroke: var(--rope); stroke-width: 3; stroke-linecap: round; }
@media (max-width: 900px) {
  .unroll { grid-template-columns: 1fr; }
  .unroll-text, .unroll-figure { grid-column: 1 / -1; }
  .unroll .statement { min-height: 0; }
}

/* ---------- Catálogo ---------- */
.catalog { padding: var(--section) var(--m) 0; }
.catalog-head { display: grid; grid-template-columns: repeat(12, 1fr); gap: var(--gap); align-items: end; }
.catalog-head h2 { grid-column: 1 / span 5; font-size: clamp(56px, 8vw, 132px); letter-spacing: -0.04em; }
.catalog-head p { grid-column: 7 / -1; max-width: 32em; }
.filters { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.filters .chip { background: var(--linen); color: var(--ink); }
.filters .chip:hover { background: #e0d1bd; }
.filters .chip[aria-pressed="true"] { background: var(--ink); color: var(--ground); }
@media (max-width: 760px) { .catalog-head h2, .catalog-head p { grid-column: 1 / -1; } }

.pieces { display: grid; grid-template-columns: repeat(12, 1fr); gap: clamp(48px, 6vw, 96px) var(--gap); margin-top: clamp(40px, 5vw, 72px); }
.status { grid-column: 1 / -1; font-size: 20px; }
.piece { grid-column: span 6; display: flex; flex-direction: column; }
.piece:nth-child(3n + 1) { grid-column: span 7; }
.piece:nth-child(3n + 2) { grid-column: span 5; margin-top: clamp(0px, 10vw, 160px); }
.piece:nth-child(3n) { grid-column: 3 / span 8; }
.piece .frame { overflow: hidden; background: var(--linen); aspect-ratio: 4 / 5; }
.piece:nth-child(3n) .frame { aspect-ratio: 16 / 10; }
.piece img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.piece:hover img { transform: scale(1.04); }
.piece-info { display: grid; grid-template-columns: 1fr auto; gap: 6px 24px; margin-top: 20px; align-items: baseline; }
.piece h3 { font-size: clamp(30px, 2.8vw, 44px); letter-spacing: -0.02em; }
.price { font-family: var(--display); font-size: clamp(26px, 2.2vw, 34px); font-weight: 600; font-variant-numeric: lining-nums; white-space: nowrap; }
.piece-meta { grid-column: 1 / -1; color: var(--ink-soft); font-size: 16px; }
.piece-desc { grid-column: 1 / -1; max-width: 36em; }
.piece .tag { margin-top: 4px; grid-column: 1 / -1; justify-self: start; }
.piece .btn { grid-column: 1 / -1; justify-self: start; margin-top: 12px; }
@media (max-width: 760px) {
  .piece, .piece:nth-child(3n + 1), .piece:nth-child(3n + 2), .piece:nth-child(3n) { grid-column: 1 / -1; margin-top: 0; }
  .piece:nth-child(3n) .frame { aspect-ratio: 4 / 5; }
}

/* ---------- Casamentos e eventos ---------- */
.events { display: grid; grid-template-columns: repeat(12, 1fr); gap: clamp(40px, 5vw, 80px) var(--gap); padding: var(--section) var(--m) 0; align-items: start; }
.events-text { grid-column: 1 / span 6; display: flex; flex-direction: column; gap: 24px; align-self: center; }
.events h2 { font-size: clamp(34px, 4vw, 68px); max-width: 12em; }
.events .actions { margin-top: 8px; }
.events figure { margin: 0; }
.events .frame { overflow: hidden; background: var(--linen); }
.events img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.events figure:hover img { transform: scale(1.03); }
.ev-title { grid-column: 1 / -1; font-size: clamp(32px, 3.4vw, 56px); margin-top: clamp(24px, 4vw, 64px); margin-bottom: -16px; }
.ev-arco { grid-column: 7 / -1; }
.order-note { margin-top: 20px; max-width: 34em; color: var(--ink-soft); }
.ev-arco .frame { aspect-ratio: 5 / 4; }
.ev-noivos { grid-column: 1 / span 5; grid-row: span 2; }
.ev-noivos .frame { aspect-ratio: 4 / 5; }
.ev-cortina { grid-column: 6 / span 4; grid-row: span 2; margin-top: clamp(0px, 6vw, 96px); }
.ev-cortina .frame { aspect-ratio: 3 / 4; }
.ev-corredor, .ev-rosas { grid-column: 10 / -1; }
.ev-corredor .frame, .ev-rosas .frame { aspect-ratio: 4 / 5; }
.ev-suspenso { grid-column: 1 / span 4; }
.ev-lustre { grid-column: 5 / span 4; margin-top: clamp(0px, 8vw, 128px); }
.ev-luminaria { grid-column: 9 / -1; }
.ev-suspenso .frame, .ev-lustre .frame, .ev-luminaria .frame { aspect-ratio: 2 / 3; }
@media (max-width: 900px) {
  .events-text, .ev { grid-column: 1 / -1; grid-row: auto; margin-top: 0; }
  .ev-corredor, .ev-suspenso { grid-column: 1 / span 6; }
  .ev-rosas, .ev-lustre { grid-column: 7 / -1; }
  .events { row-gap: 32px; }
}

/* ---------- Encomenda ---------- */
.order { display: grid; grid-template-columns: repeat(12, 1fr); gap: var(--gap); padding: var(--section) var(--m) 0; align-items: start; }
.order-text { grid-column: 1 / span 6; }
.order h2 { font-size: clamp(44px, 5vw, 84px); max-width: 9em; }
.steps { margin: 40px 0 44px; padding-left: 1.4em; display: flex; flex-direction: column; gap: 22px; max-width: 34em; }
.steps li { padding-left: .3em; }
.steps li::marker { font-family: var(--display); font-weight: 600; font-size: 1.4em; color: var(--rope); }
.order-media { grid-column: 8 / -1; margin: 0; position: sticky; top: 100px; }
.order-media .frame { overflow: hidden; aspect-ratio: 4 / 5; background: var(--linen); }
.order-media img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 900px) { .order-text, .order-media { grid-column: 1 / -1; position: static; } .order-media .frame { aspect-ratio: 4 / 3; } }

/* ---------- Ofício ---------- */
.craft { margin-top: var(--section); background: var(--linen); padding: clamp(72px, 9vw, 140px) var(--m); }
.craft h2 { font-size: clamp(44px, 5.4vw, 92px); max-width: 11em; }
.craft-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: var(--gap); margin-top: clamp(40px, 5vw, 72px); align-items: start; }
.craft-old { grid-column: 1 / span 4; margin: 0; }
.craft-old .frame { background: #f2ead9; padding: 6%; }
.craft-text { grid-column: 6 / span 7; display: flex; flex-direction: column; gap: 24px; }
.craft-text p { max-width: 38em; }
.craft-lead { font-family: var(--display); font-size: clamp(24px, 2.3vw, 34px); line-height: 1.2; letter-spacing: -0.01em; }
.credit { display: block; font-size: 13px; margin-top: 2px; }
.credit a { color: inherit; }
@media (max-width: 900px) {
  .craft-old, .craft-text { grid-column: 1 / -1; }
  .craft-old { max-width: 420px; }
}

/* ---------- Sob medida ---------- */
.custom { background: var(--rope); color: var(--on-rope); padding: clamp(80px, 10vw, 160px) var(--m); display: grid; grid-template-columns: repeat(12, 1fr); gap: var(--gap); align-items: end; }
.custom h2 { grid-column: 1 / span 7; font-size: clamp(48px, 6.4vw, 108px); letter-spacing: -0.035em; }
.custom .statement { grid-column: 8 / -1; color: var(--on-rope); }
.custom .btn { grid-column: 8 / -1; justify-self: start; margin-top: 8px; }
@media (max-width: 900px) { .custom h2, .custom .statement, .custom .btn { grid-column: 1 / -1; } }

/* ---------- Rodapé ---------- */
.foot { background: var(--field); color: var(--on-field); padding: clamp(56px, 7vw, 96px) var(--m) 32px; }
.foot-name { font-family: var(--display); font-weight: 600; font-size: clamp(36px, 4.6vw, 64px); line-height: 1; letter-spacing: -0.02em; }
.foot-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px 32px; margin-top: 32px; font-size: 18px; }
.foot-links { display: flex; gap: 14px; margin: 0; }
.foot-icon {
  display: inline-grid; place-items: center; width: 52px; height: 52px; border-radius: 50%;
  background: #46342a; color: var(--on-field); transition: background .2s var(--ease), transform .2s var(--ease);
}
.foot-icon:hover { background: var(--rope); transform: translateY(-2px); }
.foot-icon[hidden] { display: none; }
.foot-icon svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.foot-icon svg .dot, .foot-icon svg .fone { fill: currentColor; stroke: none; }
.credits { margin-top: 40px; font-size: 14px; color: var(--on-field-soft); max-width: 70em; }

/* ---------- Corda que acompanha a rolagem ---------- */
body { position: relative; }
#scroll-rope { position: absolute; top: 0; left: 0; z-index: 15; pointer-events: none; overflow: visible; }
/* corda de algodão cru, como a da foto: contorno, corpo, torções e brilho */
#scroll-rope path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
#scroll-rope .sr-reveal { stroke: #fff; stroke-linecap: butt; }
#scroll-rope .sr-shadow { stroke: rgba(46, 33, 25, .22); }
#scroll-rope .sr-edge { stroke: #8f7c62; }
#scroll-rope .sr-body { stroke: #dfd4c1; }
#scroll-rope .sr-light { stroke: #f2ebdf; }
#scroll-rope .sr-shine { stroke: #fffdf9; opacity: .9; }
#scroll-rope .sr-twist { stroke: #a8967a; stroke-linecap: round; }
#scroll-rope .sr-twist-light { stroke: #fffaf1; stroke-linecap: round; opacity: .8; }
#scroll-rope .sr-fio-borda { stroke: #9d8a6f; stroke-width: 4.2; }
#scroll-rope .sr-fio { stroke: #f4efe4; stroke-width: 2.4; }
#scroll-rope .sr-amarra { fill: #f4efe4; stroke: #9d8a6f; stroke-width: 1.6; }
#scroll-rope .sr-sway { transform-origin: 0 0; }
@media (prefers-reduced-motion: no-preference) {
  #scroll-rope:not(.rolando) .sr-sway { animation: balanca 2.6s ease-in-out infinite; }
}
@keyframes balanca { 0%, 100% { transform: rotate(-7deg); } 50% { transform: rotate(7deg); } }

/* ---------- Entradas (só com JS e sem redução de movimento) ---------- */
@media (prefers-reduced-motion: no-preference) {
  .js [data-reveal] { opacity: 0; transform: translateY(24px); transition: opacity .7s var(--ease), transform .7s var(--ease); transition-delay: var(--d, 0ms); }
  .js [data-reveal].in { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-media img { animation: none; }
  #rope-path { transition: none; }
  .piece img, .btn, .chip { transition: none; }
}
