/* GripLab corporate site. Static, dependency-free. Fonts are self-hosted
   (SIL OFL 1.1; licences in assets/fonts/). */

@font-face {
  font-family: "Newsreader";
  src: url("assets/fonts/newsreader-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 300 600;
  font-display: swap;
}

@font-face {
  font-family: "Newsreader";
  src: url("assets/fonts/newsreader-italic-latin.woff2") format("woff2");
  font-style: italic;
  font-weight: 300 600;
  font-display: swap;
}

@font-face {
  font-family: "Inter";
  src: url("assets/fonts/inter-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
}

:root {
  color-scheme: light dark;

  --paper: #f4f2ed;
  --paper-raised: #fbfaf7;
  --ink: #16181d;
  --muted: #4a4f57;
  --faint: #656a72;
  --line: rgba(22, 24, 29, 0.13);
  --line-strong: rgba(22, 24, 29, 0.28);
  --accent: #a3431f;
  --accent-mark: #c2552b;
  --mark-cut: #f4f2ed;
  --night: #15171b;
  --night-text: #ece9e2;
  --night-muted: #b4b1aa;
  --night-line: rgba(236, 233, 226, 0.16);
  --focus: #a3431f;

  --font-display: "Newsreader", "Iowan Old Style", Charter, Georgia, serif;
  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --gutter: 16px;
  --max: 1180px;
}

@media (min-width: 640px) {
  :root { --gutter: 32px; }
}

@media (min-width: 1024px) {
  :root { --gutter: 48px; }
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #121418;
    --paper-raised: #1a1d22;
    --ink: #ece9e2;
    --muted: #b9b6af;
    --faint: #9a978f;
    --line: rgba(236, 233, 226, 0.13);
    --line-strong: rgba(236, 233, 226, 0.3);
    --accent: #e08a62;
    --accent-mark: #d4683c;
    --mark-cut: #121418;
    --night: #0b0c0f;
    --focus: #e08a62;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 88px;
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

h1,
h2,
h3,
p,
dl,
dd,
ul,
ol,
figure {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
}

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

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: 2px;
}

main:focus {
  outline: none;
}

.wrap {
  width: 100%;
  max-width: calc(var(--max) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -60px;
  z-index: 20;
  padding: 10px 16px;
  background: var(--ink);
  color: var(--paper);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  top: 12px;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  border-bottom: 1px solid var(--line);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  backdrop-filter: saturate(140%) blur(10px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
}

.brand-mark {
  flex: none;
  width: 28px;
  height: 28px;
  color: var(--ink);
}

.brand-name {
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: 560;
  letter-spacing: -0.02em;
  line-height: 1;
}

.nav-list {
  display: flex;
  gap: 4px;
}

.nav-list a {
  display: inline-block;
  padding: 10px 6px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s ease;
}

.nav-list a:hover {
  color: var(--ink);
}

@media (min-width: 640px) {
  .nav-list { gap: 12px; }
  .nav-list a { padding-inline: 8px; }
}

/* ---------- Shared type ---------- */

.eyebrow {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--faint);
}

.eyebrow .index {
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.display {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.75rem, 8.4vw, 6.25rem);
  line-height: 0.98;
  letter-spacing: -0.035em;
  text-wrap: balance;
  font-variation-settings: "opsz" 72;
}

.display em {
  font-style: italic;
  color: var(--accent);
}

.headline {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 1.04;
  letter-spacing: -0.03em;
  text-wrap: balance;
  font-variation-settings: "opsz" 72;
}

.section {
  padding-block: clamp(64px, 10vw, 128px);
  border-top: 1px solid var(--line);
}

.section-head {
  display: grid;
  gap: 20px;
  max-width: 760px;
}

/* ---------- Buttons ---------- */

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 28px;
  margin-top: 40px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 12px 22px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.15s ease, transform 0.15s ease;
}

.button:hover {
  background: var(--accent);
}

.button .icon {
  width: 14px;
  height: 14px;
}

.text-link {
  display: inline-block;
  padding-block: 12px;
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 6px;
}

.text-link:hover {
  color: var(--accent);
}

/* ---------- Hero ---------- */

.hero {
  padding-block: clamp(56px, 11vw, 136px) clamp(56px, 9vw, 112px);
}

.hero-grid {
  display: grid;
  gap: 56px;
}

.lede {
  margin-top: 28px;
  max-width: 34rem;
  font-size: clamp(1.0625rem, 1.6vw, 1.1875rem);
  line-height: 1.65;
  color: var(--muted);
}

.portfolio {
  border-top: 1px solid var(--line-strong);
}

.portfolio-label {
  padding-block: 14px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--faint);
  border-bottom: 1px solid var(--line);
}

.portfolio-item {
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: center;
  column-gap: 14px;
  row-gap: 6px;
  padding-block: 22px;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
}

.portfolio-index {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.portfolio-item .openmat-mark {
  width: 36px;
  height: 36px;
}

.portfolio-name {
  font-family: var(--font-sans);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.1;
}

.portfolio-url {
  grid-column: 3;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.875rem;
  color: var(--muted);
  transition: color 0.15s ease;
}

.portfolio-url .icon {
  width: 12px;
  height: 12px;
}

.portfolio-item:hover .portfolio-url {
  color: var(--accent);
}

@media (min-width: 960px) {
  .hero-grid {
    grid-template-columns: minmax(0, 1.55fr) minmax(0, 0.75fr);
    align-items: end;
    gap: 72px;
  }
}

/* ---------- Product ---------- */

.product-card {
  display: grid;
  gap: 48px;
  margin-top: 56px;
  padding: 28px 20px;
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: 20px;
}

.openmat-lockup {
  display: flex;
  align-items: center;
  gap: 14px;
}

.openmat-mark {
  flex: none;
}

.openmat-mark-lg {
  width: 52px;
  height: 52px;
}

/* OpenMat keeps its own mark and a heavy sans name so it reads as a distinct
   product, not a GripLab sub-brand. */
.openmat-name {
  font-family: var(--font-sans);
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.1;
}

.openmat-tag {
  margin-top: 2px;
  font-size: 0.8125rem;
  color: var(--faint);
}

.product-body {
  margin-top: 24px;
  max-width: 32rem;
  color: var(--muted);
}

.button-openmat {
  margin-top: 28px;
  background: #0f3d32;
  color: #faf8f2;
}

.button-openmat:hover {
  background: #1e6b56;
}

.feature-list {
  border-top: 1px solid var(--line-strong);
}

.feature-list li {
  display: grid;
  gap: 4px;
  padding-block: 18px;
  border-bottom: 1px solid var(--line);
}

.feature-name {
  font-family: var(--font-display);
  font-size: 1.375rem;
  letter-spacing: -0.01em;
}

.feature-body {
  color: var(--muted);
  font-size: 0.9375rem;
}

.product-shot {
  grid-column: 1 / -1;
}

.shot-frame {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfaf8;
  box-shadow: 0 1px 0 var(--line), 0 30px 60px -36px rgba(22, 24, 29, 0.45);
}

.shot-frame img {
  width: 100%;
  height: auto;
}

.product-shot figcaption {
  margin-top: 12px;
  font-size: 0.8125rem;
  color: var(--faint);
}

@media (min-width: 640px) {
  .product-card { padding: 40px; }
  .feature-list li {
    grid-template-columns: 9rem 1fr;
    gap: 24px;
    align-items: baseline;
  }
}

@media (min-width: 960px) {
  .product-card {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    gap: 64px;
    padding: 56px;
  }
}

/* ---------- About ---------- */

.about-grid {
  display: grid;
  gap: 32px;
}

.about-copy {
  display: grid;
  gap: 28px;
  max-width: 36rem;
  font-size: clamp(1.0625rem, 1.6vw, 1.1875rem);
  line-height: 1.65;
  color: var(--muted);
}

.about-product {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 16px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  font-size: 1rem;
  color: var(--ink);
}

.about-product .text-link {
  padding-block: 8px;
}

@media (min-width: 960px) {
  .about-grid {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    gap: 72px;
    align-items: start;
  }
}

/* ---------- Contact ---------- */

.contact {
  background: var(--night);
  color: var(--night-text);
  border-top: 0;
}

.contact .eyebrow {
  color: var(--night-muted);
}

.contact .eyebrow .index {
  color: #e08a62;
}

.contact-grid {
  display: grid;
  gap: 48px;
}

.contact-list {
  border-top: 1px solid var(--night-line);
}

.contact-list li {
  display: grid;
  gap: 6px;
  padding-block: 22px;
  border-bottom: 1px solid var(--night-line);
}

.contact-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--night-muted);
}

.contact-email {
  justify-self: start;
  font-family: var(--font-display);
  font-size: clamp(1.375rem, 3.4vw, 2rem);
  letter-spacing: -0.015em;
  overflow-wrap: anywhere;
  text-decoration: underline;
  text-decoration-color: rgba(224, 138, 98, 0.7);
  text-decoration-thickness: 1px;
  text-underline-offset: 6px;
  transition: color 0.15s ease;
}

.contact-email:hover {
  color: #e08a62;
}

.contact :focus-visible {
  outline-color: #e08a62;
}

@media (min-width: 960px) {
  .contact-grid {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    gap: 72px;
    align-items: end;
  }
}

/* ---------- Footer ---------- */

.site-footer {
  background: var(--night);
  color: var(--night-muted);
  border-top: 1px solid var(--night-line);
  font-size: 0.875rem;
}

.footer-inner {
  display: grid;
  gap: 16px;
  padding-block: 32px 40px;
}

.footer-brand .brand-name {
  color: var(--night-text);
  font-size: 1.125rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
}

.footer-links a {
  display: inline-block;
  padding-block: 8px;
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--night-text);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.site-footer :focus-visible {
  outline-color: #e08a62;
}

@media (min-width: 860px) {
  .footer-inner {
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 32px;
  }
}

/* ---------- Motion & forced colours ---------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

@media (forced-colors: active) {
  .button { border: 1px solid ButtonText; }
}
