/* Codewright Software – site styles.
   Colours and fonts follow the brand pack (codewright-brand/tokens/tokens.css, theme "Messing"). */

@font-face { font-family: "Space Grotesk"; font-weight: 700; font-style: normal; font-display: swap;
  src: url("../fonts/space-grotesk-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 500; font-style: normal; font-display: swap;
  src: url("../fonts/jetbrains-mono-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 400; font-style: normal; font-display: swap;
  src: url("../fonts/inter-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 500; font-style: normal; font-display: swap;
  src: url("../fonts/inter-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 600; font-style: normal; font-display: swap;
  src: url("../fonts/inter-latin-600-normal.woff2") format("woff2"); }

:root {
  /* Brand tokens */
  --cw-ink: #12161C;
  --cw-paper: #F3F1EC;
  --cw-accent: #D9A441;
  --cw-accent-dark: #8A5E0E;
  --cw-muted: #A9B0BA;
  --cw-muted-on-light: #4A525C;
  --cw-surface-dark: #1B2129;
  --cw-surface-light: #E7E4DC;
  --cw-line-dark: #262D37;
  --cw-line-light: #D8D4CA;
  --cw-font-display: "Space Grotesk", "Helvetica Neue", Arial, sans-serif;
  --cw-font-mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  --cw-font-body: "Inter", "Helvetica Neue", Arial, sans-serif;

  /* Roles, light theme */
  color-scheme: light;
  --bg: var(--cw-paper);
  --fg: var(--cw-ink);
  --fg-soft: #2B3138;
  --muted: var(--cw-muted-on-light);
  --accent: var(--cw-accent-dark);
  --accent-on-surface: #774F08;
  --surface: var(--cw-surface-light);
  --line: var(--cw-line-light);
  --rule: var(--cw-ink);
  --button-bg: var(--cw-ink);
  --button-fg: var(--cw-paper);
  --footer-bg: var(--cw-ink);
  --footer-line: var(--cw-line-dark);
  --visual-line: transparent;
}

/* Roles, dark theme. The site is light by default, also when the system is set to dark.
   Dark is used only when the visitor chooses it with the button in the header. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: var(--cw-ink);
  --fg: var(--cw-paper);
  --fg-soft: #C9CED6;
  --muted: var(--cw-muted);
  --accent: var(--cw-accent);
  --accent-on-surface: var(--cw-accent);
  --surface: var(--cw-surface-dark);
  --line: var(--cw-line-dark);
  --rule: var(--cw-paper);
  --button-bg: var(--cw-accent);
  --button-fg: var(--cw-ink);
  --footer-bg: #0D1015;
  --visual-line: var(--cw-line-dark);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--cw-font-body); font-size: 17px; line-height: 1.6; }
img { max-width: 100%; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--fg); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
h1, h2, h3 { font-family: var(--cw-font-display); font-weight: 700; margin: 0; }
p { margin: 0; }

.wrap { max-width: 1240px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }
.mono { font-family: var(--cw-font-mono); font-weight: 500; text-transform: uppercase; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; z-index: 10; background: var(--button-bg); color: var(--button-fg); padding: 10px 14px; border-radius: 6px; }

/* Theme-dependent logos: both are in the markup, one is shown.
   !important, because later rules set display on the same images. */
.only-dark { display: none !important; }
:root[data-theme="dark"] .only-dark { display: block !important; }
:root[data-theme="dark"] .only-light { display: none !important; }

/* Header */
.site-header { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; padding-top: 28px; padding-bottom: 28px; }
.site-header .logo { display: flex; align-items: center; }
.site-header .logo img { height: 36px; width: auto; display: block; }
.nav { display: flex; flex-wrap: wrap; gap: 8px 28px; align-items: center; font-size: 15px; font-weight: 500; }
.nav a { color: var(--fg); text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }
.nav a:hover { color: var(--accent); }
.nav a.button { background: var(--button-bg); color: var(--button-fg); padding: 0 20px; border-radius: 6px; }
.nav a.button:hover { opacity: 0.88; color: var(--button-fg); }
.theme-toggle { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; background: transparent; color: var(--fg); border: 1px solid var(--line); border-radius: 6px; cursor: pointer; padding: 0; }
.theme-toggle:hover { border-color: var(--fg); }
.theme-toggle svg { width: 20px; height: 20px; }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* Hero */
.hero { padding-top: 96px; padding-bottom: 80px; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 48px; }
.hero h1 { flex: 1 1 100%; max-width: 1060px; font-size: clamp(42px, 6.4vw, 92px); line-height: 1; letter-spacing: -0.03em; }
.hero .lead { flex: 0 1 520px; font-size: 20px; line-height: 1.55; color: var(--muted); }
.hero .facts { font-size: 13px; line-height: 1.9; letter-spacing: 0.06em; color: var(--muted); }

/* Work */
.work { padding-bottom: 112px; }
.work-head { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 2px solid var(--rule); padding-bottom: 14px; }
.work-head h2 { font-family: var(--cw-font-mono); font-weight: 500; font-size: 13px; letter-spacing: 0.22em; text-transform: uppercase; }
.work-head span { font-family: var(--cw-font-mono); font-size: 13px; color: var(--muted); }
.product { display: flex; flex-wrap: wrap; gap: 32px; padding: 40px 0; }
.product + .product { border-top: 1px solid var(--line); }
.product-text { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.product-kind { font-family: var(--cw-font-mono); font-size: 13px; color: var(--accent); }
.product h3 { font-size: 48px; letter-spacing: -0.02em; line-height: 1; }
.product-text > p { color: var(--muted); }
.spec { margin: 8px 0 0; display: grid; grid-template-columns: 110px minmax(0, 1fr); row-gap: 8px; font-size: 14px; }
.spec dt { font-family: var(--cw-font-mono); font-size: 12px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); padding-top: 2px; }
.spec dd { margin: 0; }
.more { font-weight: 600; min-height: 44px; display: inline-flex; align-items: center; align-self: flex-start; }
.product-visual { flex: 2 1 480px; min-width: 0; min-height: 340px; margin: 0; border-radius: 12px; border: 1px solid var(--visual-line); overflow: hidden; display: flex; }
.product-visual img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Product visuals keep each product's own colours, not Codewright's. */
.visual-bolt { background: #101217; padding: 22px; display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 14px; }
.visual-bolt .tree { background: #13161C; border: 1px solid #232731; border-radius: 8px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.visual-bolt .tree i { display: block; height: 9px; border-radius: 3px; background: #2A2F3A; }
.visual-bolt .tree i.on { background: #F5B83D; }
.visual-bolt .tree i:nth-child(1) { width: 55%; }
.visual-bolt .tree i:nth-child(2) { width: 80%; }
.visual-bolt .tree i:nth-child(3) { width: 70%; }
.visual-bolt .tree i:nth-child(4) { width: 88%; }
.visual-bolt .tree i:nth-child(5) { width: 62%; }
.visual-bolt .pane { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: auto 1fr; gap: 12px; }
.visual-bolt .tile { background: #171A21; border: 1px solid #232731; border-radius: 8px; padding: 14px; font-family: var(--cw-font-mono); font-size: 12px; color: #A3ACBA; }
.visual-bolt .tile b { display: block; font-weight: 500; margin-top: 4px; }
.visual-bolt .up { color: #86E0A5; }
.visual-bolt .slow { color: #FDBA74; }
.visual-bolt .wide { grid-column: 1 / -1; }
.visual-fabriore { background: repeating-linear-gradient(135deg, #1E1C17 0 14px, #1A1814 14px 28px); border-color: rgba(201, 161, 90, 0.24); align-items: center; justify-content: center; }
.visual-fabriore span { font-family: var(--cw-font-mono); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: #C3AD80; border: 1px solid rgba(201, 161, 90, 0.4); padding: 8px 12px; border-radius: 4px; }
@media (max-width: 520px) { .visual-bolt { grid-template-columns: 96px minmax(0, 1fr); padding: 14px; } }

/* About */
.about { background: var(--surface); }
.about .wrap { padding-top: 104px; padding-bottom: 104px; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 56px; }
.about .lockup { height: 72px; width: auto; }
.about h2 { margin-top: 28px; font-size: 44px; line-height: 1.08; letter-spacing: -0.02em; }
.about-text { display: flex; flex-direction: column; gap: 20px; font-size: 18px; line-height: 1.65; color: var(--fg-soft); }
.about-text .more { font-size: 16px; color: var(--accent-on-surface); }
.about-text .more:hover { color: var(--fg); }

/* Footer (always dark) */
.site-footer { background: var(--footer-bg); color: var(--cw-paper); border-top: 1px solid var(--footer-line); }
.site-footer .cols { padding-top: 72px; padding-bottom: 40px; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 40px; }
.site-footer .logo img { height: 32px; width: auto; display: block; }
.site-footer .col { font-size: 15px; line-height: 1.8; color: var(--cw-muted); }
.site-footer .col h2 { font-family: var(--cw-font-mono); font-weight: 500; font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--cw-accent); }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer a { color: var(--cw-paper); }
.site-footer a:hover { color: var(--cw-accent); }
.site-footer .legal { padding-top: 20px; padding-bottom: 32px; border-top: 1px solid var(--cw-line-dark); font-size: 13px; color: var(--cw-muted); }

/* Error page */
.notfound { min-height: 60vh; display: flex; flex-direction: column; justify-content: center; gap: 20px; padding-top: 96px; padding-bottom: 96px; }
.notfound h1 { font-size: clamp(42px, 6.4vw, 92px); line-height: 1; letter-spacing: -0.03em; }
.notfound p { color: var(--muted); font-size: 20px; }
