/* ---------- Design tokens ----------
   Palette sourced from the real M&S logo (assets/ms-logo.jpg): deep teal,
   growth green, and slate. Paper/ink tones build the "ledger" atmosphere
   around them. Green is treated as a sharp, sparing accent — not a wash. */
:root {
  --color-teal: #036a7a;
  --color-teal-deep: #023b45;
  --color-teal-bright: #0299a8;
  --color-green: #7eb92c;
  --color-slate: #46545d;

  --color-paper: #f6efe1;
  --color-paper-card: #fffcf4;
  --color-ink: #17262a;
  --color-ink-muted: #566268;
  --color-line: rgba(23, 38, 42, 0.14);
  --color-line-soft: rgba(3, 106, 122, 0.07);
  --color-white: #ffffff;

  --font-display: "Piazzolla", Georgia, "Times New Roman", serif;
  --font-body: "Public Sans", -apple-system, BlinkMacSystemFont, sans-serif;

  --radius: 10px;
  --radius-sm: 7px;
  --shadow-sm: 0 1px 3px rgba(23, 38, 42, 0.1);
  --shadow-md: 0 12px 28px rgba(23, 38, 42, 0.14);

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --max-width: 1120px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--color-ink);
  background-color: var(--color-paper);
  /* Engraved security-paper texture (concentric-ring guilloché), the pattern
     printed on banknotes, checks, and stock certificates — chosen after
     ruled/grid lines read as school-notebook paper instead of a financial
     document. Inlined as a data URI (not a separate asset) to keep the site
     dependency-free; source SVG kept below for future edits. */
  background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMjAiIGhlaWdodD0iMTIwIiB2aWV3Qm94PSIwIDAgMTIwIDEyMCI+PGcgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjMDM2YTdhIiBzdHJva2Utd2lkdGg9IjAuNSIgc3Ryb2tlLW9wYWNpdHk9IjAuMDYiPjxjaXJjbGUgY3g9IjYwIiBjeT0iNjAiIHI9IjE4Ii8+PGNpcmNsZSBjeD0iNjAiIGN5PSI2MCIgcj0iMzIiLz48Y2lyY2xlIGN4PSIwIiBjeT0iMCIgcj0iMzIiLz48Y2lyY2xlIGN4PSIxMjAiIGN5PSIwIiByPSIzMiIvPjxjaXJjbGUgY3g9IjAiIGN5PSIxMjAiIHI9IjMyIi8+PGNpcmNsZSBjeD0iMTIwIiBjeT0iMTIwIiByPSIzMiIvPjwvZz48L3N2Zz4=");
  background-size: 120px 120px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Source for the data URI above — edit here, then re-encode with:
   python3 -c "import base64; print(base64.b64encode(open('pattern.svg','rb').read()).decode())"

<svg xmlns="http://www.w3.org/2000/svg" width="120" height="120" viewBox="0 0 120 120">
  <g fill="none" stroke="#036a7a" stroke-width="0.5" stroke-opacity="0.06">
    <circle cx="60" cy="60" r="18"/>
    <circle cx="60" cy="60" r="32"/>
    <circle cx="0" cy="0" r="32"/>
    <circle cx="120" cy="0" r="32"/>
    <circle cx="0" cy="120" r="32"/>
    <circle cx="120" cy="120" r="32"/>
  </g>
</svg>

Tuning notes: the first pass (80px tile, 3 rings, 0.14 opacity) looked fine
in an isolated mockup but was overwhelming across a full page — this
120px/2-ring/0.06-opacity version is the one that actually reads as quiet
atmosphere at real page scale. Verify any future change against a full
rendered page, not a small swatch.
*/

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

a {
  color: inherit;
  text-decoration: none;
}

ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

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

h2 {
  font-size: clamp(1.6rem, 2.5vw, 2.1rem);
}

p {
  margin: 0 0 1em;
}

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

.eyebrow {
  display: inline-block;
  font-family: var(--font-body);
  color: var(--color-teal-deep);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.76rem;
  margin-bottom: 0.9em;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 0.85em 1.75em;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-family: var(--font-body);
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: transform 0.18s var(--ease-out), box-shadow 0.18s var(--ease-out),
    background 0.18s var(--ease-out), color 0.18s var(--ease-out);
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  background: var(--color-green);
  color: var(--color-teal-deep);
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  /* Background intentionally stays Growth Green on hover, not a darker
     shade — Deep Harbor Teal Deep text on a darkened green fails WCAG AA
     contrast (was 3.15:1 against the 4.5:1 minimum). Shadow + lift alone
     carry the hover signal here, same as cards. */
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: transparent;
  color: var(--color-teal-deep);
  border-color: var(--color-teal-deep);
}

.btn-secondary:hover {
  background: var(--color-teal-deep);
  color: var(--color-paper);
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(246, 239, 225, 0.86);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid transparent;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.site-header.is-scrolled {
  box-shadow: var(--shadow-sm);
  border-bottom-color: var(--color-line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.25rem;
  color: var(--color-teal-deep);
}

.brand-mark-icon {
  height: 38px;
  width: 38px;
  flex: 0 0 auto;
}

/* logo bar-chart "grow in" animation — inlined per-page (not <img src>) so it
   reliably plays; Safari does not run CSS animations on images loaded via
   <img src="*.svg">, which left the mark stuck mid-animation there. */
@keyframes msRiseIn {
  from {
    opacity: 0;
    transform: translateY(26px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.ms-slate,
.ms-teal,
.ms-bar-1,
.ms-bar-2,
.ms-bar-3,
.ms-arrow {
  animation: msRiseIn 0.55s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.ms-slate {
  animation-delay: 0.48s;
}

.ms-teal {
  animation-delay: 0.05s;
}

.ms-bar-1 {
  animation-delay: 0.16s;
}

.ms-bar-2 {
  animation-delay: 0.27s;
}

.ms-bar-3 {
  animation-delay: 0.38s;
}

.ms-arrow {
  animation-delay: 0.58s;
}

.brand-name {
  display: flex;
  align-items: baseline;
  gap: 7px;
}

.brand-mark {
  font-family: var(--font-body);
  font-weight: 700;
}

.brand-m {
  color: var(--color-teal);
}

.brand-amp {
  color: var(--color-slate);
}

.brand-s {
  color: var(--color-teal);
}

.brand-tail {
  font-family: var(--font-display);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 30px;
}

.main-nav a {
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--color-ink);
  position: relative;
  padding: 4px 0;
}

.main-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  height: 2px;
  width: 100%;
  background: var(--color-green);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.2s var(--ease-out);
}

.main-nav a:hover::after,
.main-nav a.active::after {
  transform: scaleX(1);
}

.main-nav a.active {
  color: var(--color-teal-deep);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}

/* language dropdown */
.lang-select {
  position: relative;
  font-family: var(--font-body);
}

.lang-select-toggle {
  display: flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-sm);
  background: var(--color-paper-card);
  padding: 7px 11px;
  font-family: inherit;
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--color-teal-deep);
  cursor: pointer;
  transition: border-color 0.18s var(--ease-out);
}

.lang-select-toggle:hover {
  border-color: var(--color-teal);
}

.lang-select-toggle svg {
  color: var(--color-ink-muted);
  transition: transform 0.2s var(--ease-out);
}

.lang-select.is-open .lang-select-toggle svg {
  transform: rotate(180deg);
}

.lang-select-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 132px;
  margin: 0;
  padding: 4px;
  list-style: none;
  background: var(--color-paper-card);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.18s var(--ease-out), transform 0.18s var(--ease-out), visibility 0.18s;
  z-index: 200;
}

.lang-select.is-open .lang-select-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.lang-select-menu li {
  padding: 8px 10px;
  border-radius: 5px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-ink);
  cursor: pointer;
}

.lang-select-menu li:hover,
.lang-select-menu li:focus-visible {
  background: var(--color-paper);
}

.lang-select-menu li:focus-visible {
  outline: 2px solid var(--color-green);
  outline-offset: -2px;
}

.lang-select-menu li[aria-selected="true"] {
  color: var(--color-teal-deep);
  font-weight: 700;
  background: var(--color-paper);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}

.nav-toggle span {
  width: 24px;
  height: 2px;
  background: var(--color-teal-deep);
  border-radius: 2px;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: 100px 0 76px;
}

.hero::before {
  content: "&";
  position: absolute;
  right: -20px;
  top: -110px;
  font-family: var(--font-display);
  font-size: 400px;
  font-weight: 600;
  font-style: italic;
  color: var(--color-teal);
  opacity: 0.06;
  line-height: 1;
  pointer-events: none;
  z-index: 0;
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 720px;
}

.hero-inner > * {
  animation: fadeUpIn 0.7s var(--ease-out) both;
}

.hero-inner > *:nth-child(1) {
  animation-delay: 0.05s;
}

.hero-inner > *:nth-child(2) {
  animation-delay: 0.16s;
}

.hero-inner > *:nth-child(3) {
  animation-delay: 0.3s;
}

.hero-inner > *:nth-child(4) {
  animation-delay: 0.44s;
}

.hero h1 {
  font-size: clamp(2.1rem, 4vw, 3rem);
}

.hero .subtitle {
  color: var(--color-ink-muted);
  font-size: 1.12rem;
  max-width: 60ch;
}

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

/* page header for interior pages */
.page-header {
  position: relative;
  overflow: hidden;
  padding: 84px 0 52px;
}

.page-header::before {
  content: attr(data-mark);
  position: absolute;
  right: -10px;
  top: -90px;
  font-family: var(--font-display);
  font-size: 300px;
  font-weight: 600;
  font-style: italic;
  color: var(--color-teal);
  opacity: 0.07;
  line-height: 1;
  pointer-events: none;
  z-index: 0;
}

.page-header .container {
  position: relative;
  z-index: 1;
}

.page-header .container > * {
  animation: fadeUpIn 0.6s var(--ease-out) both;
}

.page-header .container > *:nth-child(1) {
  animation-delay: 0.05s;
}

.page-header .container > *:nth-child(2) {
  animation-delay: 0.16s;
}

.page-header .container > *:nth-child(3) {
  animation-delay: 0.28s;
}

.page-header h1 {
  font-size: clamp(1.9rem, 3.5vw, 2.6rem);
}

.page-header .subtitle {
  color: var(--color-ink-muted);
  max-width: 65ch;
}

@keyframes fadeUpIn {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------- Sections ---------- */
.section {
  padding: 76px 0;
}

.section-alt {
  background: linear-gradient(155deg, var(--color-teal-deep) 0%, var(--color-teal) 100%);
  color: rgba(246, 239, 225, 0.9);
}

.section-alt .eyebrow {
  color: var(--color-green);
}

.section-alt h2 {
  color: var(--color-paper);
}

.section-alt p {
  color: rgba(246, 239, 225, 0.82);
}

.section-alt .values-list strong {
  color: var(--color-paper);
}

.section-alt .values-list span {
  color: rgba(246, 239, 225, 0.78);
}

.section-header {
  max-width: 640px;
  margin: 0 auto 40px;
  text-align: center;
}

.section-header.align-left {
  margin: 0 0 40px;
  text-align: left;
}

/* ---------- Cards / grid ---------- */
.grid {
  display: grid;
  gap: 24px;
}

.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.card {
  background: var(--color-paper-card);
  border: 1px solid var(--color-line);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out),
    border-color 0.25s var(--ease-out);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--color-teal);
}

.card-icon {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-sm);
  background: var(--color-teal-deep);
  color: var(--color-green);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  font-size: 1.3rem;
  font-family: var(--font-body);
  font-weight: 600;
}

.card h3 {
  font-size: 1.15rem;
  margin-bottom: 0.4em;
}

.card p {
  color: var(--color-ink-muted);
  margin-bottom: 0;
}

/* stagger card reveals within a grid */
.grid .reveal:nth-child(1) {
  transition-delay: 0s;
}

.grid .reveal:nth-child(2) {
  transition-delay: 0.09s;
}

.grid .reveal:nth-child(3) {
  transition-delay: 0.18s;
}

.grid .reveal:nth-child(4) {
  transition-delay: 0.27s;
}

/* ---------- About / team ---------- */
.team-card {
  background: var(--color-paper-card);
  border: 1px solid var(--color-line);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow-sm);
  text-align: center;
}

.team-card .role {
  color: var(--color-ink-muted);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.9em;
}

.team-card p:last-child {
  color: var(--color-ink-muted);
  margin-bottom: 0;
}

.founder-avatar {
  width: 104px;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius);
  background: var(--color-teal-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-green);
  font-family: var(--font-display);
  font-weight: 600;
  font-style: italic;
  font-size: 1.9rem;
  margin: 0 auto 18px;
}

.values-list li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.values-list .dot {
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--color-green);
  margin-top: 8px;
  box-shadow: 0 0 0 3px rgba(126, 185, 44, 0.22);
}

.values-list strong {
  display: block;
  color: var(--color-teal-deep);
  font-family: var(--font-display);
  font-weight: 600;
}

/* ---------- CTA banner ---------- */
.cta-banner {
  background: linear-gradient(135deg, var(--color-teal-deep) 0%, var(--color-teal) 100%);
  color: var(--color-white);
  border-radius: var(--radius);
  padding: 52px 48px;
  text-align: center;
}

.cta-banner h2 {
  color: var(--color-paper);
}

.cta-banner p {
  color: rgba(246, 239, 225, 0.85);
  max-width: 55ch;
  margin-left: auto;
  margin-right: auto;
}

/* ---------- Contact ---------- */
.contact-form-wrap {
  max-width: 620px;
  margin: 0 auto;
}

form {
  background: var(--color-paper-card);
  border: 1px solid var(--color-line);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow-sm);
}

.form-row {
  margin-bottom: 18px;
}

.form-row label {
  display: block;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  margin-bottom: 7px;
  color: var(--color-teal-deep);
}

.form-row input,
.form-row textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-line);
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--color-ink);
  background: var(--color-white);
}

.form-row input:focus,
.form-row textarea:focus {
  outline: none;
  border-color: var(--color-green);
  box-shadow: 0 0 0 3px rgba(126, 185, 44, 0.2);
}

.form-note {
  font-size: 0.85rem;
  color: var(--color-ink-muted);
  margin-top: 10px;
  margin-bottom: 0;
}

.form-status[data-state="success"] {
  color: var(--color-green);
  font-weight: 600;
}

.form-status[data-state="error"] {
  color: #b3261e;
  font-weight: 600;
}

form:has(button:disabled) {
  opacity: 0.85;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--color-teal-deep);
  color: rgba(246, 239, 225, 0.78);
  padding: 40px 0;
  margin-top: 40px;
  border-top: 3px solid var(--color-green);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 32px;
  padding-bottom: 28px;
  margin-bottom: 24px;
  border-bottom: 1px solid rgba(246, 239, 225, 0.15);
}

.footer-brand {
  color: var(--color-paper);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
}

.footer-tagline {
  font-size: 0.85rem;
  margin: 4px 0 0;
}

.footer-col h4 {
  font-family: var(--font-body);
  color: var(--color-green);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 0 0 14px;
}

.footer-col p,
.footer-contact-row {
  font-size: 0.85rem;
  margin: 0 0 8px;
}

.footer-col p:last-child,
.footer-contact-row:last-child {
  margin-bottom: 0;
}

.footer-contact-row {
  display: flex;
  align-items: center;
  gap: 9px;
  width: fit-content;
  transition: color 0.18s var(--ease-out);
}

.footer-contact-row:hover {
  color: var(--color-paper);
}

.footer-contact-row svg {
  flex: 0 0 auto;
  color: var(--color-green);
}

.footer-bottom {
  font-family: var(--font-body);
  font-size: 0.76rem;
  color: rgba(246, 239, 225, 0.65);
}

/* ---------- Reveal-on-scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

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

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }

  .footer-grid .footer-col:first-child {
    grid-column: 1 / -1;
  }

  .hero::before,
  .page-header::before {
    font-size: 260px;
  }
}

@media (max-width: 640px) {
  /* Vertical rhythm (hero/page-header padding, section padding) was tuned
     for desktop only. Unreduced, a page-header's bottom padding (52px)
     stacks with the next section's top padding (76px) into 128px of dead
     space on mobile — e.g. between the Contact subtitle and the form, or
     the About subtitle and "For more than 30 years...". Tightened here. */
  .hero {
    padding: 56px 0 44px;
  }

  .page-header {
    padding: 48px 0 16px;
  }

  .section {
    padding: 32px 0;
  }

  .main-nav {
    position: fixed;
    top: 68px;
    left: 0;
    right: 0;
    background: var(--color-paper);
    flex-direction: column;
    align-items: flex-start;
    padding: 20px 24px;
    gap: 18px;
    box-shadow: var(--shadow-md);
    transform: translateY(-150%);
    transition: transform 0.25s var(--ease-out);
  }

  .main-nav.is-open {
    transform: translateY(0);
  }

  .nav-toggle {
    display: flex;
  }

  .grid-3,
  .grid-2 {
    grid-template-columns: 1fr;
  }

  .cta-banner {
    padding: 32px 24px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 24px;
    text-align: center;
  }

  .footer-contact-row {
    justify-content: center;
    margin-left: auto;
    margin-right: auto;
  }

  .footer-bottom {
    text-align: center;
  }

  .hero::before,
  .page-header::before {
    font-size: 180px;
    opacity: 0.05;
  }

  .brand-tail {
    display: none;
  }

  .hero-actions {
    justify-content: center;
  }

  .section-alt .btn-primary,
  .contact-form-wrap .btn-primary {
    display: block;
    width: fit-content;
    margin: 0 auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-inner > *,
  .page-header .container > *,
  .reveal,
  .ms-slate,
  .ms-teal,
  .ms-bar-1,
  .ms-bar-2,
  .ms-bar-3,
  .ms-arrow {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}
