/* Attid Technologies PLC — site styles
   Tokens follow the brand system: Ion #5B3DF5, Ink #0E0D1A, Paper #F7F6F2.
   Type: Sora (display), Manrope (body). */

:root {
  --ion: #5B3DF5;
  --ion-deep: #3E27C4;
  --ink: #0E0D1A;
  --paper: #F7F6F2;

  --bg: #F7F6F2;
  --surface: #FFFFFF;
  --text: #0E0D1A;
  --muted: #55536A;
  --line: #E4E2DA;
  --tint: #EDEAFD;
  --mark: #0E0D1A;
}
:root[data-theme="dark"] {
  --bg: #0E0D1A; --surface: #16152A; --text: #F7F6F2; --muted: #B4B1C9;
  --line: #2A2842; --tint: #221E4A; --mark: #F7F6F2;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Manrope, "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; }
a { color: var(--ion); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--ion-deep); }
:focus-visible { outline: 3px solid var(--ion); outline-offset: 3px; border-radius: 4px; }

.wrap { width: min(1160px, 100% - 48px); margin: 0 auto; }

h1, h2, h3, h4 { font-family: Sora, Manrope, sans-serif; margin: 0; letter-spacing: -0.03em; line-height: 1.08; }
h1 { font-size: clamp(40px, 6vw, 76px); font-weight: 700; }
h2 { font-size: clamp(28px, 3.4vw, 42px); font-weight: 700; }
h3 { font-size: 22px; font-weight: 600; letter-spacing: -0.015em; }
h4 { font-size: 17px; font-weight: 600; letter-spacing: 0; }
p { margin: 0; }
.lede { font-size: clamp(18px, 1.6vw, 21px); color: var(--muted); max-width: 34em; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; justify-content: space-between; min-height: 72px; gap: 24px; }
.brand { display: inline-flex; align-items: center; text-decoration: none; color: var(--text); }
.brand svg { display: block; height: 34px; width: auto; }
.links { display: flex; gap: 4px; }
.links a {
  color: var(--text); text-decoration: none; font-weight: 600; font-size: 15px;
  padding: 12px 14px; border-radius: 10px; min-height: 44px; display: inline-flex; align-items: center;
}
.links a:hover { background: var(--tint); color: var(--text); }
.links a.cta { background: var(--ion); color: #fff; }
.links a.cta:hover { background: var(--ion-deep); }
@media (max-width: 860px) { .links a:not(.cta) { display: none; } }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: 0 24px;
  border-radius: 14px; font-weight: 700; font-size: 16px; text-decoration: none; border: 1px solid transparent;
}
.btn-primary { background: var(--ion); color: #fff; }
.btn-primary:hover { background: var(--ion-deep); color: #fff; }
.btn-quiet { background: transparent; color: var(--text); border-color: var(--line); }
.btn-quiet:hover { background: var(--tint); color: var(--text); }

/* Hero */
.hero { padding: clamp(64px, 9vw, 128px) 0 clamp(48px, 6vw, 88px); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(32px, 5vw, 80px); align-items: center; }
.hero h1 { max-width: 13ch; }
.hero .lede { margin-top: 24px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }
.hero-figure { display: flex; justify-content: center; }
.hero-figure svg { width: min(100%, 460px); height: auto; }
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-figure svg { width: min(100%, 360px); }
}

/* Sections */
.section { padding: clamp(56px, 7vw, 104px) 0; border-top: 1px solid var(--line); }
.section-head { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 24px 64px; align-items: start; }
.section-head h2 { max-width: 14ch; }
.section-head p { color: var(--muted); max-width: 36em; }
@media (max-width: 760px) { .section-head { grid-template-columns: 1fr; } }

/* Areas of work: four quiet columns */
.areas { margin-top: 48px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.areas > div { padding: 32px 28px 36px 0; border-right: 1px solid var(--line); }
.areas > div + div { padding-left: 28px; }
.areas > div:last-child { border-right: 0; }
.areas h3 { font-size: 24px; }
.areas p { margin-top: 12px; color: var(--muted); font-size: 16px; max-width: 22em; }
@media (max-width: 860px) {
  .areas { grid-template-columns: 1fr 1fr; }
  .areas > div { padding: 28px 24px 28px 0; border-bottom: 1px solid var(--line); }
  .areas > div:nth-child(2n) { border-right: 0; padding-left: 24px; }
  .areas > div:nth-child(2n+1) { padding-left: 0; }
  .areas > div:nth-last-child(-n+2) { border-bottom: 0; }
}
@media (max-width: 480px) {
  .areas { grid-template-columns: 1fr; }
  .areas > div, .areas > div:nth-child(2n) { border-right: 0; padding-left: 0; border-bottom: 1px solid var(--line); }
  .areas > div:last-child { border-bottom: 0; }
}

/* Partner logos: always on white so supplied logos keep their own colours */
.logos { margin-top: 40px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.logos > div { background: #FFFFFF; border: 1px solid var(--line); border-radius: 16px; min-height: 132px; display: flex; align-items: center; justify-content: center; padding: 28px 32px; }
.logos img { max-height: 56px; width: auto; max-width: 100%; display: block; }
@media (max-width: 760px) { .logos { grid-template-columns: 1fr 1fr; } .logos > div { min-height: 108px; padding: 20px; } }
@media (max-width: 460px) { .logos { grid-template-columns: 1fr; } }

/* Company */
.company { margin-top: 48px; display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 40px 64px; }
.company h4 { margin-bottom: 10px; }
.company p { color: var(--muted); font-size: 16px; }
.company dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 15px; }
.company dt { color: var(--muted); }
.company dd { margin: 0; font-weight: 600; }
@media (max-width: 760px) { .company { grid-template-columns: 1fr; } }

/* Contact */
.contact { background: var(--ion); color: #fff; border-top: 0; }
.contact h2 { color: #fff; }
.contact-grid { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 6fr); gap: 32px 64px; align-items: end; }
.contact p { color: rgba(255,255,255,0.86); max-width: 30em; margin-top: 16px; }
.contact-lines { display: grid; gap: 8px; }
.contact-lines a {
  color: #fff; text-decoration: none; font-family: Sora, sans-serif; font-weight: 600;
  font-size: clamp(22px, 3vw, 34px); letter-spacing: -0.02em; line-height: 1.25;
  padding: 10px 0; border-bottom: 2px solid rgba(255,255,255,0.35); display: inline-block; min-height: 44px;
}
.contact-lines a:hover { border-bottom-color: #fff; color: #fff; }
.contact-lines small { display: block; font-family: Manrope, sans-serif; font-weight: 600; font-size: 14px; color: rgba(255,255,255,0.8); margin-top: 18px; }
@media (max-width: 760px) { .contact-grid { grid-template-columns: 1fr; } }

/* Footer */
.site-footer { padding: 40px 0 48px; border-top: 1px solid var(--line); }
.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 20px 40px; align-items: flex-start; }
.legal { color: var(--muted); font-size: 14px; line-height: 1.6; }
.legal b { color: var(--text); font-weight: 700; display: block; }
.foot nav { display: flex; gap: 20px; flex-wrap: wrap; }
.foot nav a { color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 600; min-height: 44px; display: inline-flex; align-items: center; }
.foot nav a:hover { color: var(--text); }

/* ---------- Interaction ---------- */

/* Theme toggle */
.theme-toggle {
  width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: transparent;
  color: var(--text); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0;
}
.theme-toggle:hover { background: var(--tint); }
.theme-toggle svg { width: 20px; height: 20px; display: block; }
.theme-toggle .moon { display: none; }
.theme-toggle[data-mode="dark"] .moon { display: block; }
.theme-toggle[data-mode="dark"] .sun { display: none; }
.nav-right { display: flex; align-items: center; gap: 10px; }

/* Current section in the nav */
.links a.is-current { background: var(--tint); }

/* The mark draws itself: one page-load moment, replayable by clicking */
[data-mark] { cursor: pointer; }
[data-mark] .leg { stroke-dasharray: 1; stroke-dashoffset: 0; }
[data-mark] .dot { transform-origin: 78px 74px; transform-box: view-box; }
[data-mark].is-drawing .leg { animation: draw-leg 900ms cubic-bezier(0.65, 0, 0.35, 1) both; }
[data-mark].is-drawing .dot { animation: land-dot 420ms cubic-bezier(0.34, 1.56, 0.64, 1) 820ms both; }
@keyframes draw-leg { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes land-dot { from { transform: scale(0); } to { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) {
  [data-mark].is-drawing .leg, [data-mark].is-drawing .dot { animation: none; }
}

/* Areas: header is a real button; detail opens beneath */
.areas h3 { margin: 0; }
.area-toggle {
  all: unset; display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%;
  cursor: pointer; font: inherit; color: inherit; min-height: 44px;
}
.area-toggle:focus-visible { outline: 3px solid var(--ion); outline-offset: 4px; border-radius: 6px; }
.area-toggle .chev { width: 18px; height: 18px; flex: none; color: var(--muted); transition: transform 240ms ease; }
.area-toggle[aria-expanded="true"] .chev { transform: rotate(180deg); }
.area-detail { margin-top: 12px; color: var(--text); font-size: 15px; line-height: 1.6; max-width: 24em; }
.area-detail.is-open { animation: detail-in 260ms ease both; }
@keyframes detail-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .area-detail.is-open { animation: none; } .area-toggle .chev { transition: none; } }

/* Partners: tile answers hover and keyboard focus */
.logos > div { transition: transform 180ms ease, border-color 180ms ease; }
.logos > div:hover, .logos > div:focus-within { transform: translateY(-2px); border-color: var(--ion); }
@media (prefers-reduced-motion: reduce) { .logos > div { transition: none; } .logos > div:hover { transform: none; } }

/* Contact: copy buttons */
.contact-line { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.copy {
  all: unset; cursor: pointer; font: inherit; font-weight: 700; font-size: 13px; color: #fff;
  border: 1px solid rgba(255,255,255,0.45); border-radius: 999px; padding: 8px 12px; min-height: 36px; line-height: 1;
  display: inline-flex; align-items: center;
}
.copy:hover { background: rgba(255,255,255,0.14); }
.copy:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.copy.is-done { background: #fff; color: var(--ion); border-color: #fff; }


/* ---------- More interaction ---------- */

/* Reading progress: a thin Ion line that fills as you read */
.progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 20; pointer-events: none; }
.progress span { display: block; height: 100%; width: 0; background: var(--ion); transition: width 120ms linear; }

/* Hero: a soft light that follows the pointer; the headline arrives line by line after the mark draws */
.hero { position: relative; overflow: hidden; }
.hero-light {
  position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity 400ms ease;
  background: radial-gradient(520px circle at var(--mx, 70%) var(--my, 40%), var(--tint) 0%, transparent 60%);
}
.hero:hover .hero-light, .hero.is-lit .hero-light { opacity: 1; }
.hero-grid { position: relative; }
[data-headline] span { display: inline-block; }
.is-ready [data-headline] span { animation: line-in 600ms cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.is-ready [data-headline] span:nth-child(1) { animation-delay: 300ms; }
.is-ready [data-headline] span:nth-child(2) { animation-delay: 420ms; }
.is-ready [data-headline] span:nth-child(3) { animation-delay: 540ms; }
.is-ready .hero .lede, .is-ready .hero .actions { animation: line-in 600ms cubic-bezier(0.2, 0.7, 0.2, 1) both; animation-delay: 700ms; }
@keyframes line-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* Buttons: magnetic pull toward the pointer, and a press you can feel */
.btn { transition: transform 160ms ease, background-color 160ms ease; will-change: transform; }
.btn:active { transform: scale(0.97) !important; }
.btn-invert { background: #fff; color: var(--ion); }
.btn-invert:hover { background: #F1EEFF; color: var(--ion-deep); }

/* Mark follows the pointer a little (position updated by script) */
[data-mark] .dot { transition: transform 300ms cubic-bezier(0.2, 0.7, 0.2, 1); }
[data-mark].is-drawing .dot { transition: none; }

/* Areas: a spotlight under the pointer, and the hovered area sharpens while the rest recede */
.areas { position: relative; }
.areas > div { position: relative; transition: opacity 240ms ease; }
.areas > div::before {
  content: ""; position: absolute; inset: 0 -1px 0 0; pointer-events: none; opacity: 0; transition: opacity 240ms ease;
  background: radial-gradient(260px circle at var(--sx, 50%) var(--sy, 50%), var(--tint) 0%, transparent 70%);
}
.areas > div:hover::before, .areas > div:focus-within::before { opacity: 1; }
.areas:hover > div:not(:hover):not(:focus-within) { opacity: 0.55; }

/* Partners: a caption rises when the tile is hovered or focused */
.logo-tile { position: relative; overflow: hidden; cursor: default; }
.logo-cap {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 10px 14px; text-align: center;
  background: var(--ion); color: #fff; font-size: 13px; font-weight: 700;
  transform: translateY(100%); transition: transform 220ms cubic-bezier(0.2, 0.7, 0.2, 1);
}
.logo-tile:hover .logo-cap, .logo-tile:focus-visible .logo-cap, .logo-tile:focus .logo-cap { transform: none; }
.logo-tile:focus-visible { outline: 3px solid var(--ion); outline-offset: 2px; }

/* Principles: the one you rest on comes forward */
.principles { list-style: none; margin: 0; padding: 0; }
.principles li {
  padding: 12px 0 12px 18px; border-left: 2px solid var(--line); color: var(--muted); font-size: 16px;
  transition: color 200ms ease, border-color 200ms ease, padding-left 200ms ease; cursor: default;
}
.principles li:hover, .principles li:focus-visible, .principles li.is-on { color: var(--text); border-left-color: var(--ion); padding-left: 24px; }
.principles li:focus-visible { outline: none; }

/* Contact form: white on Ion, immediate feedback */
.contact-form { margin-top: 28px; display: grid; gap: 14px; max-width: 30em; }
.field { display: grid; gap: 6px; position: relative; }
.field label { font-size: 14px; font-weight: 700; color: rgba(255,255,255,0.9); }
.field input, .field textarea {
  font: inherit; font-size: 16px; color: var(--ink); background: #fff; border: 2px solid transparent; border-radius: 12px;
  padding: 12px 14px; min-height: 48px; width: 100%; transition: box-shadow 160ms ease, border-color 160ms ease;
}
.field textarea { resize: vertical; min-height: 96px; }
.field input:focus-visible, .field textarea:focus-visible { outline: none; border-color: #fff; box-shadow: 0 0 0 4px rgba(255,255,255,0.35); }
.field.is-invalid input, .field.is-invalid textarea { border-color: #FFD6C9; box-shadow: 0 0 0 4px rgba(255,214,201,0.35); }
.field .count { position: absolute; right: 12px; bottom: 10px; font-size: 12px; font-weight: 700; color: var(--muted); }
.form-note { font-size: 13px !important; color: rgba(255,255,255,0.8) !important; margin-top: 0 !important; }
.form-note.is-sent { color: #fff !important; font-weight: 700; }

/* Back to top: appears after the first screen */
.to-top {
  position: fixed; right: 20px; bottom: 20px; width: 48px; height: 48px; border-radius: 14px; z-index: 15;
  background: var(--ink); color: var(--paper); display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 10px 24px rgba(14,13,26,0.18); text-decoration: none;
  opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity 240ms ease, transform 240ms ease;
}
.to-top svg { width: 20px; height: 20px; }
.to-top.is-visible { opacity: 1; transform: none; pointer-events: auto; }
.to-top:hover { background: var(--ion); color: #fff; }
:root[data-theme="dark"] .to-top { background: var(--paper); color: var(--ink); }

@media (prefers-reduced-motion: reduce) {
  .is-ready [data-headline] span, .is-ready .hero .lede, .is-ready .hero .actions { animation: none; }
  .btn, .logo-cap, .principles li, .areas > div, .areas > div::before, .to-top, [data-mark] .dot, .hero-light { transition: none; }
  .areas:hover > div:not(:hover) { opacity: 1; }
}
@media (hover: none) { .areas:hover > div:not(:hover) { opacity: 1; } }
