/* Regletto website — shared by index.html and writing.html.
   Colours come from Brand/tokens.css only. Motion: opacity, transform, background-size, clip-path. */

:root {
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --t-state: 240ms;
  --t-enter: 800ms;
  --wrap: 1120px;
  --gutter: 24px;
  --soft: color-mix(in srgb, var(--ink) 80%, transparent);
  --cast: 0 1px 2px var(--cast-near), 0 14px 34px -10px var(--cast-far);
  --cast-up: 0 2px 4px var(--cast-near), 0 22px 44px -10px var(--cast-far);
  color-scheme: light dark;
}
html[data-mode='light'] { color-scheme: light; }
html[data-mode='dark'] { color-scheme: dark; }

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--base); color: var(--ink);
  font: 400 18px/1.6 'Roboto', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
  transition: background-color 400ms var(--ease), color 400ms var(--ease);
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
h1, h2, h3, p, dl, dd, figure { margin: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.wrap { width: min(var(--wrap), 100% - 2 * var(--gutter)); margin-inline: auto; }
.ms {
  font-family: 'Material Symbols Rounded'; font-weight: 400; font-style: normal; font-size: 22px; line-height: 1;
  letter-spacing: normal; text-transform: none; white-space: nowrap; display: inline-block; flex: none;
  font-feature-settings: 'liga'; -webkit-font-feature-settings: 'liga'; user-select: none;
}
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---- Type ---- */
.display { font-weight: 500; font-size: clamp(38px, 6.6vw, 72px); line-height: 1.05; letter-spacing: -0.03em; }
.title { font-weight: 500; font-size: clamp(30px, 4.2vw, 44px); line-height: 1.12; letter-spacing: -0.03em; }
.head { font-weight: 500; font-size: 24px; line-height: 1.3; }
.small { font-size: 14px; line-height: 1.5; }
.sub { color: var(--sub); }
.desk .sub { color: var(--ink); } /* --sub on --desk measures 4.24 : 1 in light, below the 4.5 line */

/* ---- Effects ---- */
.rise { opacity: 0; transform: translateY(10px); transition: opacity var(--t-enter) var(--ease), transform var(--t-enter) var(--ease); transition-delay: calc(var(--i, 0) * 90ms); }
.rise.in { opacity: 1; transform: none; }
.ink { position: relative; }
.ink::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--line);
  transform: scaleX(0); transform-origin: left; transition: transform 900ms var(--ease); transition-delay: calc(var(--i, 0) * 90ms + 120ms);
}
.ink.in::after, .in > .ink::after { transform: scaleX(1); }
.link { background: linear-gradient(currentColor, currentColor) left bottom / 0 1px no-repeat; transition: background-size var(--t-state) var(--ease); padding-bottom: 2px; }
.link:hover, .link:focus-visible { background-size: 100% 1px; }

/* ---- Glass, light and tags, shared by every page ---- */
:root {
  --void: color-mix(in srgb, var(--base) 10%, #000);
  --glass: color-mix(in srgb, var(--page) 54%, transparent);
  --glass-edge: color-mix(in srgb, var(--page) 88%, transparent);
  --hair: color-mix(in srgb, var(--ink) 11%, transparent);
}
.glass {
  background: var(--glass); -webkit-backdrop-filter: blur(20px) saturate(1.35); backdrop-filter: blur(20px) saturate(1.35);
  box-shadow: var(--cast), inset 0 0 0 1px var(--glass-edge), 0 0 0 1px var(--hair);
}
.aurora { position: absolute; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.blob { position: absolute; border-radius: 50%; filter: blur(72px); animation: roam 26s ease-in-out infinite alternate; }
.b1 { width: 560px; height: 560px; right: -5%; top: -14%; background: color-mix(in srgb, var(--accent) 34%, transparent); }
.b2 { width: 460px; height: 460px; right: 24%; bottom: -26%; background: color-mix(in srgb, var(--dim) 32%, transparent); animation-duration: 32s; animation-delay: -9s; }
.b3 { width: 400px; height: 400px; left: -9%; bottom: 4%; background: color-mix(in srgb, var(--accent) 16%, transparent); animation-duration: 29s; animation-delay: -15s; }
@keyframes roam { from { transform: translate(0, 0) scale(1); } to { transform: translate(-70px, 46px) scale(1.16); } }
.ver-tag { margin-left: -4px; padding: 3px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 13px; font-weight: 500; line-height: 1.4; letter-spacing: 0.02em; font-variant-numeric: tabular-nums; }
.halo { position: absolute; left: 12%; right: 12%; bottom: -6%; height: 62%; border-radius: 50%; background: color-mix(in srgb, var(--accent) 30%, transparent); filter: blur(64px); }

/* ---- Header: a floating glass bar over the hero, it gains weight once the page scrolls ---- */
.bar {
  position: sticky; top: 12px; z-index: 30; width: min(var(--wrap) + 28px, 100% - 24px); margin: 12px auto -68px; border-radius: 18px;
  background: color-mix(in srgb, var(--page) 58%, transparent); -webkit-backdrop-filter: blur(18px) saturate(1.4); backdrop-filter: blur(18px) saturate(1.4);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--page) 80%, transparent), 0 0 0 1px color-mix(in srgb, var(--ink) 9%, transparent);
  transition: background-color 300ms var(--ease), box-shadow 300ms var(--ease), transform 300ms var(--ease), opacity 300ms var(--ease);
  /* its own layer from the start: Safari promoting it only when the slide begins dropped the slide */
  will-change: transform;
}
/* iOS draws the page under its status bar, so its own height is not enough: it travels further and fades out */
.bar.hidden { transform: translateY(calc(-100% - 80px)); opacity: 0; pointer-events: none; }
.bar.scrolled { background: color-mix(in srgb, var(--page) 80%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--page) 80%, transparent), 0 0 0 1px color-mix(in srgb, var(--ink) 9%, transparent), var(--cast); }
.bar .wrap { display: flex; align-items: center; width: auto; height: 56px; padding: 0 10px 0 16px; gap: 4px; }
.hero { padding-top: 68px; }
.brandmark { position: absolute; top: 1.5px; right: calc(100% + 14px); display: grid; place-items: center; width: 53px; height: 53px; }
@media (max-width: 1300px) { .bar { width: auto; margin-left: 79px; margin-right: 12px; } }
.brandmark::before { content: ''; width: 53px; height: 53px; background: var(--ink); -webkit-mask: var(--brand-logo) center / contain no-repeat; mask: var(--brand-logo) center / contain no-repeat; }
.brand { display: inline-flex; align-items: center; font-weight: 500; font-size: 19px; letter-spacing: -0.02em; white-space: nowrap; padding: 6px 8px; margin-left: -8px; border-radius: 8px; }
.bar .brand + .nav { margin-left: 10px; padding-left: 12px; border-left: 1px solid color-mix(in srgb, var(--ink) 12%, transparent); }
.nav { display: flex; align-items: center; gap: 2px; }
.navbtn { display: inline-flex; align-items: center; gap: 4px; height: 38px; padding: 0 12px; border-radius: 10px; font-size: 15px; font-weight: 500; color: var(--soft); transition: background-color var(--t-state) var(--ease), color var(--t-state) var(--ease); }
.navbtn:hover, .navbtn[aria-expanded='true'] { background: var(--raise); color: var(--ink); }
.navbtn .ms { font-size: 20px; transition: transform var(--t-state) var(--ease); }
.navbtn[aria-expanded='true'] .ms { transform: rotate(180deg); }
.grow { flex: 1; }
.iconbtn { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; color: var(--soft); transition: background-color var(--t-state) var(--ease), color var(--t-state) var(--ease); }
.iconbtn:hover { background: var(--raise); color: var(--ink); }
.bar .btn.sm { margin-inline: 6px 2px; height: 38px; border-radius: 10px; background: var(--accent); color: var(--page); }
.bar .btn.sm:hover { background: var(--accent-hover); }
.menu { position: relative; }
.drop {
  position: absolute; top: calc(100% + 14px); left: -10px; min-width: 390px; padding: 8px; border-radius: 18px;
  /* solid: a blur inside the blurred bar has no backdrop of its own, the page would show through */
  background: var(--page);
  box-shadow: var(--cast-up), 0 0 0 1px color-mix(in srgb, var(--ink) 9%, transparent);
  opacity: 0; transform: translateY(-6px) scale(0.98); transform-origin: top left; visibility: hidden;
  transition: opacity var(--t-state) var(--ease), transform var(--t-state) var(--ease), visibility 0s linear var(--t-state);
}
.drop::before { content: ''; position: absolute; left: 0; right: 0; bottom: 100%; height: 16px; } /* keeps hover alive across the gap */
.menu.open .drop { opacity: 1; transform: none; visibility: visible; transition-delay: 0s; }
.droplabel { padding: 8px 12px 6px; font-size: 12px; font-weight: 500; letter-spacing: 0.09em; text-transform: uppercase; color: var(--sub); }
.dropitem { display: flex; align-items: center; gap: 14px; padding: 10px 12px; border-radius: 12px; transition: background-color var(--t-state) var(--ease); }
.dropitem:hover { background: var(--raise); }
.dropitem[aria-current='page'] { background: var(--accent-soft); }
.langmenu .drop { left: auto; right: -6px; min-width: 0; width: max-content; transform-origin: top right; }
.langmenu .dropitem { padding: 10px 20px; }
.dicon { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 13px; background: var(--base); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink) 9%, transparent), var(--cast); }
.dicon .mark { width: 26px; height: 26px; }
.dropitem b { display: flex; align-items: center; gap: 8px; font-weight: 500; font-size: 16px; line-height: 1.3; }
.dropitem em { padding: 1px 7px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-style: normal; font-size: 12px; font-weight: 500; font-variant-numeric: tabular-nums; }
.dropitem small { display: block; margin-top: 2px; font-size: 14px; color: var(--sub); line-height: 1.4; }
.mark { display: block; width: 28px; height: 28px; background: var(--ink); -webkit-mask: var(--logo) center / contain no-repeat; mask: var(--logo) center / contain no-repeat; }

/* ---- Buttons ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 20px; border-radius: 10px; font-size: 16px; font-weight: 500; background: var(--raise); transition: background-color var(--t-state) var(--ease), transform var(--t-state) var(--ease); }
.btn:hover { background: color-mix(in srgb, var(--ink) 9%, transparent); }
.btn .ms { font-size: 20px; transition: transform var(--t-state) var(--ease); }
.btn:hover .ms { transform: translateX(3px); }
.btn.main { background: var(--accent); color: var(--page); }
.btn.main:hover { background: var(--accent-hover); }
.btn.sm { height: 36px; padding: 0 14px; font-size: 15px; }

/* ---- Hero ---- */
.hero { position: relative; overflow: hidden; }
.hero .wrap { position: relative; }
.hero h1 { position: relative; }
.w, .nb { display: inline-block; white-space: nowrap; }
.c { opacity: 0; }
.c.on { opacity: 1; }
.no-type .c { opacity: 1; }
.cursor { position: absolute; top: 0.08em; width: 3px; height: 0.86em; background: var(--accent); border-radius: 2px; opacity: 0; transition: opacity var(--t-state) var(--ease); pointer-events: none; }
.cursor.show { opacity: 1; }
.cursor.blink { animation: blink 1.05s steps(1) 4; }
@keyframes blink { 50% { opacity: 0; } }

/* the one underline of the site: a real text underline that skips the descenders, drawn once the headline is typed.
   It lives on a transparent copy of the text (::after, copied into data-t by site.js) so the wipe clips only the line, never the text;
   without script the text carries it directly (see the <noscript> rule on each page) */
.u { position: relative; display: inline-block; }
.u, .u::after { text-decoration-color: var(--accent); text-decoration-thickness: max(0.075em, 4px); text-underline-offset: 0.12em; text-decoration-skip-ink: auto; }
.u::after { content: attr(data-t); content: attr(data-t) / ''; position: absolute; inset: 0; color: transparent; text-decoration-line: underline; pointer-events: none; user-select: none; clip-path: inset(-0.3em 100% -0.3em 0); transition: clip-path 900ms var(--ease); }
.u.on::after { clip-path: inset(-0.3em -0.1em -0.3em 0); }

.desk { background: var(--desk); }
.section { padding: 96px 0; }
.sechead { padding-bottom: 20px; margin-bottom: 40px; }
.sechead .title { margin: 0; }

/* screenshot follows the site mode */
html[data-mode='dark'] .shot-light { display: none !important; }
html[data-mode='dark'] .shot-dark { display: block !important; }
@media (prefers-color-scheme: dark) {
  html:not([data-mode]) .shot-light { display: none !important; }
  html:not([data-mode]) .shot-dark { display: block !important; }
}

/* ---- Footer ---- */
.foot { background: var(--base); border-top: 1px solid var(--line); padding: 64px 0 28px; }
.fgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 40px 32px; }
/* each heading sits on its own hairline, like the head of a column */
.fcol { max-width: 260px; }
.fcol h4 { margin: 0 0 18px; padding-bottom: 12px; border-bottom: 1px solid color-mix(in srgb, var(--ink) 16%, transparent); font-size: 16px; font-weight: 500; line-height: 1.4; letter-spacing: -0.005em; color: var(--ink); }
.fcol a { display: table; margin-bottom: 14px; font-size: 16px; line-height: 1.45; color: var(--soft); transition: color var(--t-state) var(--ease), background-size var(--t-state) var(--ease); }
.fcol a:hover, .fcol a:focus-visible { color: var(--ink); }
.fbottom { margin-top: 44px; padding-top: 22px; border-top: 1px solid var(--line); font-size: 15px; color: var(--soft); }
@media (max-width: 600px) { .fgrid { grid-template-columns: 1fr 1fr; } }

/* ---- Legal text: one narrow column, no hero ---- */
.legal { width: min(680px, 100% - 2 * var(--gutter)); margin-inline: auto; padding: 132px 0 96px; }
.legal .head { margin: 44px 0 12px; }
.legal p { margin-bottom: 16px; }
.legal a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line); }
.legal a:hover { text-decoration-color: currentColor; }
.legal code { font-size: 0.9em; overflow-wrap: anywhere; }

/* ---- Draft switch (not part of the site) ---- */
.draft { position: fixed; left: 16px; bottom: 16px; z-index: 60; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; max-width: calc(100vw - 32px); padding: 8px 12px; background: var(--page); border-radius: 14px; box-shadow: var(--cast-up); font-size: 13px; line-height: 1.2; }
.draft > b { font-weight: 500; color: var(--sub); }
.dg { display: flex; align-items: center; gap: 6px; }
.dg > span { color: var(--sub); }
.seg { display: inline-flex; padding: 2px; border-radius: 8px; background: var(--raise); }
.seg button { padding: 5px 10px; border-radius: 6px; transition: background-color var(--t-state) var(--ease); }
.seg button[aria-pressed='true'] { background: var(--accent); color: var(--page); }

/* ---- Small screens ---- */
.burger { display: none; }
@media (max-width: 860px) {
  .section { padding: 72px 0; }
  .bar .wrap { gap: 0; }
  .nav.full { display: none; }
  .burger { display: grid; }
  .bar.open .nav.full { display: flex; flex-direction: column; align-items: stretch; position: absolute; top: calc(100% + 8px); left: 0; right: 0; margin: 0; padding: 10px; border: 0; border-radius: 18px; background: var(--page); box-shadow: var(--cast-up), 0 0 0 1px color-mix(in srgb, var(--ink) 9%, transparent); }
  .bar.open .nav .menu .drop { position: static; min-width: 0; opacity: 1; transform: none; visibility: visible; box-shadow: none; background: none; -webkit-backdrop-filter: none; backdrop-filter: none; padding: 0; }
  .bar.open .nav .menu .navbtn .ms { display: none; }
  .hide-s { display: none; }
  /* with a download button there is no room for the name; the mark beside the bar still leads home */
  .bar:has(.btn.sm) .brand { display: none; }
  .bar .btn.sm { order: -1; margin-inline: -6px 0; }
  .draft { font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; transition-delay: 0s !important; animation: none !important; }
  .rise { opacity: 1; transform: none; }
  .ink::after, .bar::after { transform: scaleX(1); }
  .c { opacity: 1; }
  .u::after { clip-path: none; }
  .cursor { display: none; }
}
