/* Layout 1 — Editorial: estátua da Justiça, nav fullscreen, accordion, ticker */

@layer tokens, base, layout, components;

@layer tokens {
  :root {
    --ink: #17161c; --ink-soft: #55535e; --paper: #f6f3ec; --paper-raised: #ffffff;
    --line: #e2dbca; --accent: #33406f; --accent-ink: #ffffff; --accent-soft: #eceef5; --clay: #b9603c;
    --font-display: "Fraunces", Georgia, serif;
    --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
    --container: 1180px; --radius: 4px; --shadow: 0 30px 60px -30px rgb(23 22 28 / 0.35);
    color-scheme: light;
  }
}

@layer base {
  html { scroll-behavior: smooth; }
  body { background: var(--paper); color: var(--ink); font-family: var(--font-body); overflow-x: clip; }
  h1, h2, h3 { font-family: var(--font-display); font-weight: 500; letter-spacing: -0.01em; }
  .skip-link { background: var(--accent); color: var(--accent-ink); }
  :focus-visible { outline-color: var(--accent); }
  ::selection { background: var(--accent); color: var(--accent-ink); }
  .grain {
    position: fixed; inset: 0; z-index: 999; pointer-events: none; opacity: .035; mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  }
}

@layer layout {
  .wrap { max-width: var(--container); margin-inline: auto; padding-inline: clamp(1.25rem, 4vw, 2.5rem); }
  .section { padding-block: clamp(4.5rem, 10vw, 8rem); }
  .section-title { font-size: clamp(1.8rem, 3.4vw, 2.6rem); margin-block: .5rem 2.5rem; max-width: 16ch; }
  .section-title.light { color: #fff; }
  .only-desktop { display: inline-flex; }
  @media (max-width: 680px) { .only-desktop { display: none; } }
}

@layer components {
  .bar { position: sticky; top: 0; z-index: 200; background: var(--paper); }
  .info-strip { background: var(--ink); color: #fff; }
  .info-strip-inner { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding-block: .45rem; font-size: .76rem; }
  .info-strip a { opacity: .85; transition: opacity .2s ease; white-space: nowrap; }
  .info-strip a:hover { opacity: 1; }
  .info-addr { overflow: hidden; text-overflow: ellipsis; }
  .info-phone { font-weight: 600; flex-shrink: 0; }
  .bar-inner { display: flex; justify-content: space-between; align-items: center; padding-block: .9rem; border-bottom: 1px solid var(--line); }
  .mark { display: flex; flex-direction: column; gap: .15rem; line-height: 1.1; }
  .mark-line { font-family: var(--font-display); font-size: 1.2rem; color: var(--ink); }
  .mark-line.sm { font-size: 1.05rem; }
  .mark-line i { font-style: normal; color: var(--accent); }
  .mark small { font-size: .62rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); font-weight: 600; }
  .bar-actions { display: flex; align-items: center; gap: .75rem; }
  .menu-btn { display: flex; align-items: center; gap: .6rem; padding: .4rem .2rem; }
  .menu-btn-label { font-size: .82rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
  .menu-btn-icon { display: flex; flex-direction: column; gap: 4px; width: 22px; }
  .menu-btn-icon span { height: 2px; background: var(--ink); transition: transform .3s ease, width .3s ease; }
  .menu-btn-icon span:last-child { width: 60%; margin-left: auto; }
  .menu-btn[aria-expanded="true"] .menu-btn-icon span { width: 100%; }
  .menu-btn[aria-expanded="true"] .menu-btn-icon span:first-child { transform: translateY(3px) rotate(45deg); }
  .menu-btn[aria-expanded="true"] .menu-btn-icon span:last-child { transform: translateY(-3px) rotate(-45deg); }

  .overlay {
    position: fixed; inset: 0; z-index: 190; background: var(--ink); color: #fff; display: flex; align-items: center;
    clip-path: inset(0 0 100% 0); transition: clip-path .5s cubic-bezier(.65,0,.35,1); padding-top: 3.2rem;
  }
  .overlay.is-open { clip-path: inset(0 0 0 0); }
  .overlay-inner { display: flex; flex-direction: column; justify-content: space-between; height: 100%; padding-block: 2rem 3rem; width: 100%; }
  .overlay nav { display: flex; flex-direction: column; gap: .25rem; }
  .overlay nav a {
    font-family: var(--font-display); font-size: clamp(2rem, 7vw, 3.6rem); padding-block: .3rem;
    color: rgb(255 255 255 / .55); display: flex; align-items: baseline; gap: 1rem;
    transition: color .25s ease, padding-left .25s ease;
  }
  .overlay nav a::before { content: attr(data-idx); font-family: var(--font-body); font-size: .9rem; color: var(--clay); font-weight: 600; }
  .overlay nav a:hover { color: #fff; padding-left: .5rem; }
  .overlay-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1.5rem; border-top: 1px solid rgb(255 255 255 / .15); padding-top: 1.5rem; }
  .overlay-contact, .overlay-social { display: flex; flex-direction: column; gap: .5rem; font-size: .9rem; }
  .overlay-social a { opacity: .75; }
  .overlay-social a:hover { opacity: 1; }

  .btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    padding: .85rem 1.6rem; border-radius: 2px; font-weight: 600; font-size: .92rem;
    border: 1px solid transparent; transition: transform .2s ease, box-shadow .2s ease, background-color .2s ease, color .2s ease;
    white-space: nowrap;
  }
  .btn-solid { background: var(--ink); color: #fff; }
  .btn-solid:hover { background: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow); }
  .btn-line { border-color: var(--ink); color: var(--ink); }
  .btn-line:hover { background: var(--ink); color: #fff; }
  .block-ink .btn-line { border-color: rgb(255 255 255 / .4); color: #fff; }
  .block-ink .btn-line:hover { background: #fff; color: var(--ink); }

  .hero { position: relative; padding-block: clamp(2.5rem, 6vw, 4rem) clamp(3rem, 7vw, 5rem); overflow: clip; }
  .hero::before {
    content: ""; position: absolute; inset: -10% -10% auto -10%; height: 130%; z-index: -1;
    background: radial-gradient(45% 45% at 20% 25%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 70%),
                radial-gradient(35% 35% at 90% 15%, color-mix(in srgb, var(--clay) 16%, transparent), transparent 70%);
    animation: drift 22s ease-in-out infinite alternate;
  }
  @keyframes drift { from { transform: translate(0, 0) scale(1); } to { transform: translate(-2%, 3%) scale(1.06); } }

  .hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(2rem, 6vw, 4rem); align-items: center; }
  @media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; } }

  .eyebrow { display: inline-flex; align-items: center; gap: .6rem; font-size: .78rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); margin-bottom: 1.1rem; }
  .eyebrow::before { content: ""; width: 26px; height: 1px; background: var(--clay); }
  .eyebrow-light { color: #d9a084; }

  .hero h1 { font-size: clamp(2.6rem, 6vw, 4.4rem); line-height: 1.05; }
  .hero h1 em { font-style: italic; color: var(--accent); }
  .hero-lede { margin-top: 1.4rem; font-size: clamp(1rem, 1.3vw, 1.12rem); color: var(--ink-soft); max-width: 46ch; }
  .hero-cta { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 2.2rem; }

  .stat-row { display: flex; gap: clamp(1.75rem, 4vw, 3rem); margin-top: clamp(2.5rem, 6vw, 3.5rem); }
  .stat-row dt { font-family: var(--font-display); font-size: clamp(1.7rem, 3vw, 2.3rem); color: var(--ink); font-variant-numeric: tabular-nums; }
  .stat-row dd { font-size: .78rem; color: var(--ink-soft); margin-top: .15rem; }

  .portrait-frame { position: relative; display: block; overflow: hidden; border-radius: var(--radius); aspect-ratio: 4 / 5; background: var(--ink); }
  .portrait-frame img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.08) brightness(1.02); transition: transform .8s cubic-bezier(.2,.8,.2,1), filter .8s ease; }
  .portrait-frame:hover img { transform: scale(1.05); filter: grayscale(.7) contrast(1.1) brightness(1.04); }
  .portrait-frame::after { content: ""; position: absolute; inset: 0; background: linear-gradient(150deg, var(--accent) 0%, var(--clay) 100%); mix-blend-mode: color; opacity: .88; }
  .portrait-frame.sm { aspect-ratio: 1 / 1; width: 132px; height: 132px; flex-shrink: 0; }
  .portrait-frame.tone-b::after { background: linear-gradient(150deg, var(--clay) 0%, var(--accent) 100%); }
  .portrait-frame.tone-c::after { background: linear-gradient(150deg, var(--accent) 0%, #6b7bb8 100%); }

  .hero-portrait { position: relative; }
  .hero-portrait figcaption { position: absolute; left: 1.25rem; bottom: 1.25rem; color: #fff; font-size: .82rem; line-height: 1.4; }
  .hero-portrait figcaption span { opacity: .75; }

  .ticker { overflow: hidden; background: var(--ink); border-block: 1px solid rgb(255 255 255 / .1); padding-block: .9rem; }
  .ticker-track { display: flex; width: max-content; gap: 2.5rem; animation: scroll-left 32s linear infinite; }
  .ticker-track span { font-family: var(--font-display); font-style: italic; font-size: 1.05rem; color: rgb(255 255 255 / .55); white-space: nowrap; display: flex; align-items: center; gap: 2.5rem; }
  .ticker-track span::after { content: "—"; color: var(--clay); font-style: normal; }
  @keyframes scroll-left { from { transform: translateX(0); } to { transform: translateX(-50%); } }
  .ticker:hover .ticker-track { animation-play-state: paused; }

  .sobre-grid { max-width: 900px; }
  .pull { font-family: var(--font-display); font-size: clamp(1.5rem, 3.4vw, 2.35rem); line-height: 1.3; font-weight: 400; margin-bottom: 2.25rem; max-width: 22ch; }
  .pull em { font-style: italic; color: var(--accent); }
  .sobre-text p { color: var(--ink-soft); max-width: 62ch; margin-bottom: 1rem; font-size: 1.02rem; }
  .sobre-text .cities::before { content: "→ "; color: var(--clay); }

  .section-ink { background: var(--ink); color: #fff; }
  .section-ink .eyebrow { color: #d9a084; }
  .section-ink .eyebrow::before { background: var(--clay); }
  .section-ink .section-title { color: #fff; }

  .accordion { border-top: 1px solid rgb(255 255 255 / .15); }
  .accordion details { border-bottom: 1px solid rgb(255 255 255 / .15); }
  .accordion summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: clamp(1rem, 3vw, 2rem); padding-block: clamp(1.1rem, 2.4vw, 1.6rem); user-select: none; }
  .accordion summary::-webkit-details-marker { display: none; }
  .accordion .num { font-family: var(--font-display); font-size: .95rem; color: var(--clay); flex-shrink: 0; width: 2ch; }
  .accordion .t { font-family: var(--font-display); font-size: clamp(1.1rem, 2.6vw, 1.55rem); flex: 1; transition: color .2s ease; }
  .accordion summary:hover .t { color: var(--clay); }
  .accordion .chev { flex-shrink: 0; width: 12px; height: 12px; border-right: 1.5px solid #fff; border-bottom: 1.5px solid #fff; transform: rotate(45deg); transition: transform .3s ease; opacity: .6; }
  .accordion details[open] .chev { transform: rotate(-135deg); }
  .accordion details p { padding-bottom: clamp(1.1rem, 2.4vw, 1.6rem); padding-left: calc(2ch + clamp(1rem, 3vw, 2rem)); max-width: 60ch; color: rgb(255 255 255 / .65); font-size: .96rem; animation: fade-in .35s ease; }
  @keyframes fade-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }

  .team-rows { display: flex; flex-direction: column; gap: 1.5rem; }
  .team-row { display: flex; align-items: center; gap: clamp(1.5rem, 4vw, 3rem); padding-block: 1.5rem; border-bottom: 1px solid var(--line); transition: padding-left .3s ease; }
  .team-row:hover { padding-left: .5rem; }
  .team-row.reverse { flex-direction: row-reverse; text-align: right; }
  .team-row.reverse:hover { padding-left: 0; padding-right: .5rem; }
  .team-row.reverse .team-info { align-items: flex-end; }
  .team-info { display: flex; flex-direction: column; gap: .3rem; }
  .team-info h3 { font-size: clamp(1.2rem, 2.4vw, 1.6rem); }
  .team-info .role { color: var(--accent); font-weight: 600; font-size: .88rem; }
  .team-info .areas { color: var(--ink-soft); font-size: .92rem; }
  @media (max-width: 600px) {
    .team-row, .team-row.reverse { flex-direction: row; text-align: left; padding-left: 0 !important; padding-right: 0 !important; }
    .team-row.reverse .team-info { align-items: flex-start; }
  }

  .block-ink {
    position: relative; color: #fff; padding-block: clamp(4.5rem, 10vw, 8rem);
    background: linear-gradient(100deg, var(--ink) 45%, color-mix(in srgb, var(--ink) 55%, transparent) 100%), var(--bg-img) center 20% / cover no-repeat;
  }
  .block-ink::before { content: ""; position: absolute; inset: 0; background: var(--ink); opacity: .55; }
  .block-ink .wrap { position: relative; z-index: 1; }
  .block-grid { display: grid; grid-template-columns: .95fr 1.05fr; gap: clamp(2.5rem, 6vw, 5rem); align-items: start; }
  @media (max-width: 900px) { .block-grid { grid-template-columns: 1fr; } }
  .block-ink address { font-style: normal; color: rgb(255 255 255 / .7); margin-block: 1.25rem 1.5rem; line-height: 1.7; font-size: 1.02rem; }
  .contact-list li { margin-bottom: .6rem; }
  .contact-list a:not(.link-whatsapp) { font-weight: 600; color: #fff; border-bottom: 1px solid rgb(255 255 255 / .3); padding-bottom: 1px; }
  .contact-list a:not(.link-whatsapp):hover { border-color: var(--clay); color: var(--clay); }
  .portal-links { display: flex; flex-direction: column; gap: .5rem; margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid rgb(255 255 255 / .15); }
  .portal-links a { font-size: .84rem; color: rgb(255 255 255 / .55); }
  .portal-links a:hover { color: #fff; }

  .contact-form { background: var(--paper-raised); color: var(--ink); border-radius: var(--radius); padding: clamp(1.5rem, 4vw, 2.25rem); display: flex; flex-direction: column; gap: 1rem; box-shadow: var(--shadow); }
  .form-row { display: flex; flex-direction: column; gap: .4rem; }
  .form-row.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; }
  @media (max-width: 480px) { .form-row.two-col { grid-template-columns: 1fr; } }
  .form-row label { font-size: .8rem; font-weight: 600; color: var(--ink-soft); }
  .form-row input, .form-row select, .form-row textarea { padding: .7rem .85rem; border-radius: 2px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); font-size: .95rem; transition: border-color .2s ease, box-shadow .2s ease; }
  .form-row input:focus, .form-row select:focus, .form-row textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); outline: none; }
  .hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
  .form-status { font-size: .84rem; min-height: 1.2em; }
  .form-status[data-state="ok"] { color: var(--accent); }
  .form-status[data-state="err"] { color: var(--clay); }

  .foot { background: var(--paper); border-top: 1px solid var(--line); }
  .foot-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; padding-block: 2rem; }
  .foot-inner p { font-size: .8rem; color: var(--ink-soft); }
  .foot-social { display: flex; gap: 1.25rem; }
  .foot-social a { font-size: .84rem; font-weight: 600; color: var(--ink-soft); }
  .foot-social a:hover { color: var(--accent); }
  .foot-credit p { font-size: .72rem; color: var(--ink-soft); opacity: .6; padding-bottom: 1.5rem; }
}
