/* =========================================================================
   Gabinet Stomatologiczny Jan Rasinski / typographic concept redesign
   Concept: "Polsko-Japonska" heritage, est. 1990, quiet authority.
   Palette: deep forest ink + brass + warm paper. Fonts: Brygada 1918 / Cabin.
   Signature motif: thin brass rule, est. 1990 mark, ma (space) asymmetry.
   ========================================================================= */

:root {
  --canvas: #f3eee2;
  --canvas2: #e9e2d1;
  --ink: #1f3a2e;
  --muted: #5b6b5f;
  --primary: #1f3a2e;
  --primary-deep: #162a20;
  --accent: #b08738;
  --accent-soft: #e7dcc2;
  --line: #d8cfb8;

  --font-display: "Brygada 1918", Georgia, "Times New Roman", serif;
  --font-body: "Cabin", system-ui, -apple-system, "Segoe UI", sans-serif;

  --maxw: 1180px;
  --gutter: clamp(1.25rem, 5vw, 4rem);
  --rule: 1px;

  --shadow-soft: 0 1px 2px rgba(22, 42, 32, 0.05), 0 14px 40px -22px rgba(22, 42, 32, 0.28);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.075rem);
  line-height: 1.7;
  font-weight: 400;
  letter-spacing: 0.005em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--ink);
}

p { margin: 0 0 1rem; }
a { color: inherit; }

::selection { background: var(--accent); color: #fff; }

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---- reveal contract (JS-gated) ---- */
html.js [data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .7s ease, transform .7s ease;
}
html.js [data-reveal].in { opacity: 1; transform: none; }

/* ---- eyebrow / mini-label ---- */
.eyebrow {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 1.1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
}
.eyebrow::before {
  content: "";
  width: 26px;
  height: var(--rule);
  background: var(--accent);
  opacity: 0.85;
}

/* est. mark / brass rule motif */
.est-mark {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  color: var(--accent);
  letter-spacing: 0.04em;
}

.brass-rule {
  height: var(--rule);
  background: linear-gradient(90deg, var(--accent), rgba(176, 135, 56, 0));
  border: 0;
  margin: 0;
}

/* =========================================================================
   Header
   ========================================================================= */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  display: flex;
  align-items: center;
  transition: background .4s ease, box-shadow .4s ease, border-color .4s ease;
  border-bottom: var(--rule) solid transparent;
}
.site-header.scrolled {
  background: color-mix(in srgb, var(--canvas) 88%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom-color: var(--line);
}
.header-inner {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding: 1.05rem var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.brand {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  line-height: 1;
  gap: 0.18rem;
}
.brand .brand-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.12rem;
  letter-spacing: -0.005em;
  color: var(--ink);
}
.brand .brand-sub {
  font-size: 0.64rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

.nav {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2.2vw, 2.1rem);
}
.nav a {
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: 0.01em;
  position: relative;
  padding: 0.25rem 0;
  transition: color .25s ease;
}
.nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 100%;
  bottom: -2px;
  height: var(--rule);
  background: var(--accent);
  transition: right .3s ease;
}
.nav a:hover { color: var(--primary-deep); }
.nav a:hover::after { right: 0; }

.header-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.lang-toggle {
  display: inline-flex;
  border: var(--rule) solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  background: color-mix(in srgb, var(--canvas) 70%, #fff);
}
.lang-toggle button {
  appearance: none;
  border: 0;
  background: transparent;
  font-family: var(--font-body);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--muted);
  padding: 0.34rem 0.66rem;
  cursor: pointer;
  transition: background .25s ease, color .25s ease;
}
.lang-toggle button[aria-pressed="true"] {
  background: var(--primary);
  color: var(--canvas);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.92rem;
  letter-spacing: 0.01em;
  text-decoration: none;
  padding: 0.74rem 1.35rem;
  border-radius: 2px;
  border: var(--rule) solid transparent;
  cursor: pointer;
  transition: transform .2s ease, background .25s ease, color .25s ease, border-color .25s ease;
}
.btn-primary {
  background: var(--primary);
  color: var(--canvas);
}
.btn-primary:hover { background: var(--primary-deep); transform: translateY(-1px); }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--primary-deep); transform: translateY(-1px); }
.btn-accent {
  background: var(--accent);
  color: #fff;
}
.btn-accent:hover { background: #997328; transform: translateY(-1px); }

.nav-toggle {
  display: none;
  appearance: none;
  background: transparent;
  border: var(--rule) solid var(--line);
  border-radius: 4px;
  width: 42px; height: 38px;
  cursor: pointer;
  padding: 0;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
}
.nav-toggle span {
  width: 18px; height: 2px; background: var(--ink); display: block;
}

/* =========================================================================
   Hero / typographic, deep forest canvas
   ========================================================================= */
.hero {
  position: relative;
  background: var(--primary);
  color: var(--canvas);
  overflow: hidden;
  padding-top: clamp(7rem, 16vh, 10rem);
  padding-bottom: clamp(4rem, 11vh, 7rem);
}
.hero::before {
  /* subtle ma/space asymmetric brass mark */
  content: "";
  position: absolute;
  top: 0; right: 0;
  width: min(46%, 460px);
  height: 100%;
  background:
    linear-gradient(180deg, rgba(176,135,56,0.10), rgba(176,135,56,0) 70%);
  border-left: var(--rule) solid rgba(231, 220, 194, 0.16);
  pointer-events: none;
}
.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  gap: clamp(2rem, 6vw, 5rem);
  align-items: end;
}
.hero-kicker {
  color: var(--accent);
  letter-spacing: 0.28em;
}
.hero-kicker::before { background: var(--accent); }

.hero h1 {
  color: var(--canvas);
  font-size: clamp(2.7rem, 7.5vw, 5.5rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 0.98;
}
.hero h1 .given {
  display: block;
  font-style: italic;
  font-weight: 400;
  color: var(--accent-soft);
  font-size: 0.62em;
  letter-spacing: -0.005em;
  margin-bottom: 0.18em;
}
.hero h1 .since {
  display: block;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.16em;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--accent-soft) 80%, transparent);
  margin-top: 1.3em;
}
.hero-lead {
  color: color-mix(in srgb, var(--canvas) 88%, transparent);
  font-size: clamp(1.02rem, 1vw + 0.85rem, 1.2rem);
  max-width: 38ch;
  margin: 1.6rem 0 0;
}
.hero-side {
  border-left: var(--rule) solid rgba(231, 220, 194, 0.22);
  padding-left: clamp(1.2rem, 2.5vw, 2.2rem);
  padding-bottom: 0.4rem;
}
.hero-side dl {
  margin: 0;
  display: grid;
  gap: 1.2rem;
}
.hero-side dt {
  font-size: 0.66rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 0.25rem;
}
.hero-side dd {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--canvas);
  line-height: 1.35;
}
.hero-side dd a { text-decoration: none; border-bottom: var(--rule) solid rgba(176,135,56,0.5); }
.hero-side dd a:hover { border-bottom-color: var(--accent); }

.hero-cta {
  margin-top: clamp(2.4rem, 5vw, 3.4rem);
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  align-items: center;
}
.hero .btn-ghost {
  color: var(--canvas);
  border-color: rgba(231, 220, 194, 0.4);
}
.hero .btn-ghost:hover { border-color: var(--accent); color: var(--accent-soft); }

/* =========================================================================
   Section scaffolding
   ========================================================================= */
section { position: relative; }
.section {
  padding-block: clamp(4rem, 10vh, 7.5rem);
}
.section--tint { background: var(--canvas2); }

.section-head {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.6rem;
  max-width: 62ch;
  margin-bottom: clamp(2.2rem, 5vw, 3.4rem);
}
.section-head h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 600;
}
.section-head .lede {
  color: var(--muted);
  font-size: 1.1rem;
  margin-top: 0.6rem;
}

/* =========================================================================
   About / calm two-column editorial split
   ========================================================================= */
.about-grid {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: clamp(2rem, 6vw, 5rem);
  align-items: start;
}
.about-aside {
  position: sticky;
  top: 6rem;
}
.about-aside .wordmark {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  line-height: 1.05;
  letter-spacing: -0.01em;
}
.about-aside .wordmark em {
  display: block;
  font-style: italic;
  font-weight: 400;
  color: var(--accent);
  font-size: 0.62em;
  margin-top: 0.4rem;
}
.about-aside .brass-rule { margin: 1.4rem 0; width: 64px; }
.about-aside .pj {
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  line-height: 1.9;
}
.about-body p {
  font-size: clamp(1.05rem, 1vw + 0.9rem, 1.18rem);
  color: var(--ink);
  margin-bottom: 1.2rem;
}
.about-body .intro {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2.2vw, 1.7rem);
  line-height: 1.4;
  font-weight: 500;
  letter-spacing: -0.005em;
  color: var(--primary-deep);
  margin: 0 0 1.6rem;
}
.about-body p:last-child { margin-bottom: 0; }

.pillars {
  margin-top: clamp(2.4rem, 5vw, 3.2rem);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: var(--rule) solid var(--line);
}
.pillar {
  background: var(--canvas);
  padding: 1.5rem 1.4rem;
}
.section--tint .pillar { background: var(--canvas2); }
.pillar .num {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--accent);
  font-size: 1.1rem;
  display: block;
  margin-bottom: 0.5rem;
}
.pillar h3 {
  font-size: 1.18rem;
  margin-bottom: 0.4rem;
}
.pillar p { font-size: 0.95rem; color: var(--muted); margin: 0; }

/* =========================================================================
   Services / restrained editorial list
   ========================================================================= */
.svc-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--line);
  border: var(--rule) solid var(--line);
}
.svc {
  background: var(--canvas);
  padding: clamp(1.5rem, 3vw, 2.1rem);
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  transition: background .3s ease;
}
.svc:hover { background: color-mix(in srgb, var(--canvas) 80%, var(--accent-soft)); }
.svc .svc-idx {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--accent);
  font-size: 0.95rem;
  letter-spacing: 0.04em;
}
.svc h3 {
  font-size: clamp(1.25rem, 2vw, 1.5rem);
  font-weight: 600;
}
.svc p { font-size: 0.97rem; color: var(--muted); margin: 0; }

.svc-note {
  margin-top: 1.6rem;
  font-size: 0.86rem;
  color: var(--muted);
  font-style: italic;
  max-width: 70ch;
}

/* =========================================================================
   Testimonials / quiet, sourced
   ========================================================================= */
.quotes {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(1.5rem, 4vw, 2.6rem);
}
.quote {
  background: var(--canvas);
  border: var(--rule) solid var(--line);
  border-top: 2px solid var(--accent);
  padding: clamp(1.7rem, 3vw, 2.4rem);
  display: flex;
  flex-direction: column;
}
.section--tint .quote { background: var(--canvas2); }
.quote blockquote {
  margin: 0 0 1.2rem;
  font-family: var(--font-display);
  font-size: clamp(1.18rem, 1.6vw, 1.42rem);
  line-height: 1.5;
  font-weight: 500;
  color: var(--primary-deep);
}
.quote blockquote::before {
  content: "\201E";
  color: var(--accent);
  font-size: 2.2em;
  line-height: 0;
  position: relative;
  top: 0.35em;
  margin-right: 0.06em;
}
.quote .quote-meta {
  margin-top: auto;
  font-size: 0.82rem;
  color: var(--muted);
  letter-spacing: 0.02em;
}
.quote .quote-meta strong { color: var(--ink); font-weight: 600; }
.quotes-source {
  margin-top: 1.5rem;
  font-size: 0.82rem;
  color: var(--muted);
}
.quotes-source a { color: var(--primary-deep); }

/* =========================================================================
   Visit / contact
   ========================================================================= */
.visit-grid {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}
.info-block { margin-bottom: 1.9rem; }
.info-block:last-child { margin-bottom: 0; }
.info-block .label {
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 0.5rem;
}
.info-block .value {
  font-family: var(--font-display);
  font-size: 1.18rem;
  line-height: 1.45;
  color: var(--ink);
}
.info-block .value a {
  text-decoration: none;
  border-bottom: var(--rule) solid var(--accent);
  transition: color .25s ease;
}
.info-block .value a:hover { color: var(--accent); }
.hours-table {
  font-family: var(--font-body);
  font-size: 1rem;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.3rem 1.4rem;
  color: var(--ink);
}
.hours-table .day { color: var(--muted); }
.hours-note {
  margin-top: 0.7rem;
  font-size: 0.8rem;
  font-style: italic;
  color: var(--muted);
}

.map-frame {
  border: var(--rule) solid var(--line);
  border-top: 2px solid var(--accent);
  background: var(--canvas2);
  padding: 0.5rem;
  box-shadow: var(--shadow-soft);
}
.map-frame iframe {
  display: block;
  width: 100%;
  height: 340px;
  border: 0;
  filter: saturate(0.9) contrast(0.98);
}

/* contact form (demo) */
.contact-card {
  background: var(--canvas);
  border: var(--rule) solid var(--line);
  padding: clamp(1.6rem, 3vw, 2.2rem);
  box-shadow: var(--shadow-soft);
}
.section--tint .contact-card { background: var(--canvas2); }
.contact-card h3 { font-size: 1.4rem; margin-bottom: 0.4rem; }
.form-intro { font-size: 0.92rem; color: var(--muted); margin-bottom: 1.4rem; }
.field { margin-bottom: 1rem; }
.field label {
  display: block;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 0.4rem;
}
.field input,
.field textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--ink);
  background: var(--canvas);
  border: var(--rule) solid var(--line);
  border-radius: 2px;
  padding: 0.7rem 0.85rem;
  transition: border-color .25s ease, box-shadow .25s ease;
}
.section--tint .field input,
.section--tint .field textarea { background: var(--canvas); }
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(176, 135, 56, 0.16);
}
.field textarea { resize: vertical; min-height: 110px; }
.form-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.9rem;
}
.form-ok {
  margin-top: 1rem;
  padding: 0.8rem 1rem;
  background: var(--accent-soft);
  border: var(--rule) solid var(--accent);
  border-radius: 2px;
  font-size: 0.92rem;
  color: var(--primary-deep);
}
.form-disclaim {
  margin-top: 1.2rem;
  font-size: 0.78rem;
  font-style: italic;
  color: var(--muted);
}

/* =========================================================================
   Footer
   ========================================================================= */
.site-footer {
  background: var(--primary-deep);
  color: color-mix(in srgb, var(--canvas) 86%, transparent);
  padding-block: clamp(3rem, 7vh, 4.5rem) 2rem;
}
.footer-top {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: clamp(1.6rem, 4vw, 3rem);
  padding-bottom: 2.4rem;
  border-bottom: var(--rule) solid rgba(231, 220, 194, 0.16);
}
.footer-brand .fb-name {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--canvas);
  font-weight: 600;
}
.footer-brand .fb-since {
  display: inline-block;
  margin-top: 0.6rem;
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
}
.footer-brand p {
  margin-top: 1rem;
  font-size: 0.92rem;
  max-width: 40ch;
  color: color-mix(in srgb, var(--canvas) 76%, transparent);
}
.footer-col h4 {
  font-family: var(--font-body);
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 0.9rem;
}
.footer-col a, .footer-col p {
  display: block;
  color: color-mix(in srgb, var(--canvas) 82%, transparent);
  text-decoration: none;
  font-size: 0.94rem;
  margin: 0 0 0.5rem;
  transition: color .25s ease;
}
.footer-col a:hover { color: var(--accent); }
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1.8rem;
  font-size: 0.8rem;
  color: color-mix(in srgb, var(--canvas) 64%, transparent);
}
.footer-disclaimer {
  max-width: 62ch;
  line-height: 1.6;
}

/* =========================================================================
   Responsive
   ========================================================================= */
@media (max-width: 900px) {
  .nav {
    position: fixed;
    inset: 0 0 0 auto;
    width: min(78vw, 320px);
    background: var(--canvas);
    border-left: var(--rule) solid var(--line);
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 1.6rem;
    padding: 2rem;
    transform: translateX(100%);
    transition: transform .35s ease;
    box-shadow: var(--shadow-soft);
  }
  .nav.open { transform: translateX(0); }
  .nav a { font-size: 1.2rem; }
  .nav-toggle { display: inline-flex; }

  .hero-grid { grid-template-columns: 1fr; gap: 2.6rem; }
  .hero-side { border-left: 0; padding-left: 0; border-top: var(--rule) solid rgba(231,220,194,0.22); padding-top: 1.6rem; }
  .hero-side dl { grid-template-columns: 1fr 1fr; }

  .about-grid { grid-template-columns: 1fr; gap: 2.2rem; }
  .about-aside { position: static; }
  .visit-grid { grid-template-columns: 1fr; }
  .footer-top { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 620px) {
  .svc-list { grid-template-columns: 1fr; }
  .quotes { grid-template-columns: 1fr; }
  .pillars { grid-template-columns: 1fr; }
  .hero-side dl { grid-template-columns: 1fr; }
  .footer-top { grid-template-columns: 1fr; }
  .header-cta .btn-primary { display: none; }
}

/* focus visibility */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}
