/* Logvik site. Neutrals shared with ohsh; the accent is the logo's sea-green water
   (assets/brand/README.md). */

:root {
  --bg: #f2eee3;
  --bg-raised: #e9e3d3;
  --bg-sunken: #e3ddcb;
  --rule: #d3cbb4;
  --ink: #1c2118;
  --ink-2: #4a4d43;
  --ink-3: #686b61;
  --accent: #2c6e6a;

  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --gutter: clamp(1rem, 4vw, 2.5rem);
  --header-h: 4.5rem;
  --press: 4px;
  --t: 100ms ease-out;

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1f1e1d;
    --bg-raised: #2a2725;
    --bg-sunken: #131312;
    --rule: #3a3633;
    --ink: #ece8df;
    --ink-2: #c9c3b6;
    --ink-3: #9a948a;
    --accent: #6fb0a8;
  }
}

/* ---------- Base ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-wrap: break-word;
}

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

h1,
h2,
h3 {
  margin: 0;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

p {
  margin: 0;
}

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

code {
  font-family: var(--mono);
  font-size: 0.9em;
}

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

.wrap {
  max-width: 72rem;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---------- Links and focus ---------- */

a {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-color: var(--rule);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
  transition: color var(--t), text-decoration-color var(--t), text-decoration-thickness var(--t),
    text-underline-offset var(--t);
}

/* Visited links keep the same look on purpose: this is a small site, not a reading list. */
a:visited {
  color: inherit;
}

a:hover {
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.18em;
}

a:active {
  color: var(--accent);
  text-decoration-color: var(--accent);
}

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

:focus:not(:focus-visible) {
  outline: none;
}

.skip-link {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 100;
  padding: 0.625rem 1rem;
  background: var(--ink);
  color: var(--bg);
  font-family: var(--mono);
  font-size: 0.875rem;
  text-decoration: none;
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
}

.skip-link:visited {
  color: var(--bg);
}

main:focus {
  outline: none;
}

/* ---------- Labels and markers ---------- */

.label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  line-height: 1.4;
  text-transform: uppercase;
}

/* Small square marker with a hard 2px offset shadow. */
.label::before {
  content: "";
  flex: none;
  width: 0.5rem;
  height: 0.5rem;
  background: var(--accent);
  box-shadow: 2px 2px 0 var(--rule);
}

.label__num {
  color: var(--ink);
}

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

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.25rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0.6875rem 1.25rem;
  border: 1px solid var(--ink);
  font-family: var(--mono);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  line-height: 1.2;
  text-decoration: none;
  text-transform: uppercase;
  cursor: pointer;
  user-select: none;
  transition: transform var(--t), box-shadow var(--t), background-color var(--t), color var(--t),
    border-color var(--t);
}

/* Primary: a solid block on a hard shadow. Pressing pushes it onto the shadow. */
.btn--primary,
.btn--primary:visited {
  background: var(--ink);
  color: var(--bg);
  box-shadow: var(--press) var(--press) 0 var(--rule);
}

.btn--primary:hover {
  transform: translate(-1px, -1px);
  box-shadow: calc(var(--press) + 1px) calc(var(--press) + 1px) 0 var(--rule);
}

.btn--primary:active {
  color: var(--bg);
  transform: translate(var(--press), var(--press));
  box-shadow: 0 0 0 var(--rule);
  transition-duration: 60ms;
}

/* Secondary: outlined, raises its background on hover, presses in slightly. */
.btn--secondary,
.btn--secondary:visited {
  background: transparent;
  color: var(--ink);
}

.btn--secondary:hover {
  background: var(--bg-raised);
}

.btn--secondary:active {
  color: var(--ink);
  background: var(--bg-sunken);
  transform: translate(2px, 2px);
  transition-duration: 60ms;
}

.btn:focus-visible {
  outline-offset: 4px;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  border-bottom: 1px solid var(--rule);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  text-decoration: none;
}

.brand img {
  height: 32px;
  width: auto;
}

.site-nav ul {
  display: flex;
  gap: clamp(0.25rem, 2vw, 1.5rem);
}

.site-nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding-inline: 0.5rem;
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-decoration: none;
  text-transform: uppercase;
}

.site-nav a:hover,
.site-nav a[aria-current] {
  color: var(--ink);
}

.site-nav a:active {
  color: var(--accent);
}

/* Bar under the section in view, set by the IntersectionObserver in index.html. */
.site-nav a::after {
  content: "";
  position: absolute;
  left: 0.5rem;
  right: 0.5rem;
  bottom: 0.375rem;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 120ms ease-out;
}

.site-nav a[aria-current]::after {
  transform: scaleX(1);
}

@media (max-width: 40rem) {
  .site-nav__wide {
    display: none;
  }
}

/* ---------- Sections ---------- */

section[id] {
  scroll-margin-top: var(--header-h);
}

.section {
  padding-block: clamp(3.5rem, 8vw, 6rem);
  border-top: 1px solid var(--rule);
}

.section__head {
  max-width: 44rem;
  margin-bottom: clamp(2rem, 4vw, 3rem);
}

.section__head h2,
.about h2 {
  font-size: clamp(1.625rem, 3.2vw, 2.25rem);
}

.section__sub {
  margin-top: 1rem;
  color: var(--ink-2);
  font-size: 1.125rem;
}

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

.hero {
  padding-block: clamp(3.5rem, 9vw, 7rem);
}

.hero h1 {
  max-width: 22ch;
  font-size: clamp(2.25rem, 5.2vw, 3.75rem);
  line-height: 1.08;
  letter-spacing: -0.025em;
}

.lede {
  max-width: 42rem;
  margin-top: 1.75rem;
  color: var(--ink-2);
  font-size: clamp(1.0625rem, 1.6vw, 1.25rem);
}

.hero .actions {
  margin-top: 2.5rem;
}

/* ---------- Square bullets ---------- */

.squares li {
  position: relative;
  padding-left: 1.25rem;
}

.squares li + li {
  margin-top: 0.375rem;
}

.squares li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.68em;
  width: 0.375rem;
  height: 0.375rem;
  background: var(--ink-3);
}

/* ---------- Tool cards ---------- */

.cards {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 52rem) {
  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--rule);
  background: var(--bg);
  transition: border-color var(--t);
}

.card:hover,
.card:focus-within {
  border-color: var(--ink-3);
}

.card__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--rule);
}

.card__name {
  font-family: var(--mono);
  font-size: 1.5rem;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.status::before {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  background: currentColor;
}

.status--ok::before {
  background: var(--accent);
}

.card__desc {
  padding: 1.25rem 1.5rem 0;
  color: var(--ink);
}

.card__desc--last {
  padding-bottom: 1.5rem;
}

.card .squares {
  padding: 1.25rem 1.5rem 1.5rem;
  color: var(--ink-2);
  font-size: 0.9375rem;
}

.card__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  margin-top: auto;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--rule);
  background: var(--bg-raised);
}

.cmd {
  padding: 0.375rem 0.625rem;
  border: 1px solid var(--rule);
  background: var(--bg-sunken);
  color: var(--ink);
  font-size: 0.875rem;
  white-space: nowrap;
}

.cmd::before {
  content: "$ ";
  color: var(--ink-3);
  user-select: none;
}

.card__links {
  display: flex;
  gap: 0.25rem 1rem;
  font-family: var(--mono);
  font-size: 0.875rem;
}

.card__links a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding-inline: 0.25rem;
}

.card__note {
  color: var(--ink-2);
  font-size: 0.9375rem;
  min-height: 2.75rem;
  display: flex;
  align-items: center;
}

/* ---------- Expertise matrix ---------- */

.matrix {
  display: grid;
  border-top: 1px solid var(--rule);
  border-left: 1px solid var(--rule);
}

@media (min-width: 46rem) {
  .matrix {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.matrix__cell {
  position: relative;
  padding: 1.75rem 1.5rem 1.75rem 4rem;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.matrix__key {
  position: absolute;
  left: 1.5rem;
  top: 1.75rem;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.6rem;
}

.matrix h3 {
  font-size: 1.1875rem;
  line-height: 1.6rem;
}

.matrix p {
  margin-top: 0.75rem;
  color: var(--ink-2);
  font-size: 0.9375rem;
}

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

.about {
  display: grid;
  gap: 2.5rem;
}

@media (min-width: 52rem) {
  .about {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr);
    gap: 4rem;
  }
}

.about__mark {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(2rem, 6vw, 4rem);
  border: 1px solid var(--rule);
  background: var(--bg-raised);
}

.about__mark img {
  width: auto;
  height: clamp(7rem, 16vw, 11rem);
}

.about__text p.about__lead:not(.label) {
  margin-top: 0;
  color: var(--ink);
  font-size: clamp(1.25rem, 2.2vw, 1.5rem);
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: -0.01em;
}

.about__text p:not(.label) {
  max-width: 40rem;
  margin-top: 1.25rem;
  color: var(--ink-2);
}


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

.form {
  display: grid;
  max-width: 44rem;
  gap: 1.25rem;
  padding: clamp(1.25rem, 3vw, 2rem);
  border: 1px solid var(--rule);
  background: var(--bg-raised);
}

.form__row {
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 36rem) {
  .form__row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.field {
  display: grid;
  gap: 0.375rem;
}

.field label {
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.field__opt {
  color: var(--ink-3);
  text-transform: none;
  letter-spacing: 0;
}

.field input,
.field textarea {
  width: 100%;
  min-height: 2.75rem;
  padding: 0.625rem 0.75rem;
  border: 1px solid var(--rule);
  border-radius: 0;
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
  transition: border-color var(--t);
}

.field textarea {
  resize: vertical;
  min-height: 9rem;
}

.field input:hover,
.field textarea:hover {
  border-color: var(--ink-3);
}

.field input:focus-visible,
.field textarea:focus-visible {
  border-color: var(--ink);
  outline-offset: 2px;
}

.form__trap {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
  margin-top: 0.25rem;
}

.btn:disabled {
  opacity: 0.6;
  cursor: progress;
  transform: none;
}

.form__status {
  color: var(--ink-2);
  font-size: 0.9375rem;
}

.form__status[data-kind="ok"] {
  color: var(--accent);
}

.form__status[data-kind="error"] {
  color: var(--ink);
  font-weight: 500;
}

/* Confirmation panel: replaces the form after a successful send. */
.form-done {
  display: none;
  max-width: 44rem;
  padding: clamp(1.25rem, 3vw, 2rem);
  border: 1px solid var(--rule);
  border-left: 4px solid var(--accent);
  background: var(--bg-raised);
  scroll-margin-top: calc(var(--header-h) + 1.5rem);
}

.form-done.is-shown,
.form-done:target {
  display: block;
}

/* Without JavaScript the redirect lands on #message-sent: hide the form then. */
.form-done:target ~ .form {
  display: none;
}

.form-done:focus {
  outline: none;
}

.form-done__title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--ink);
  font-size: 1.375rem;
  font-weight: 600;
}

.form-done__title::before {
  content: "";
  flex: none;
  width: 0.625rem;
  height: 0.625rem;
  background: var(--accent);
  box-shadow: 2px 2px 0 var(--rule);
}

.form-done p:not(.form-done__title) {
  margin-top: 0.75rem;
  color: var(--ink-2);
}

.form-done__again {
  margin-top: 1.5rem;
}

.form[hidden] {
  display: none;
}

.form__note {
  color: var(--ink-3);
  font-size: 0.8125rem;
}

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

.site-footer {
  border-top: 1px solid var(--rule);
  background: var(--bg-raised);
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 0.8125rem;
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  min-height: 4.5rem;
}

.site-footer a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  color: var(--ink-2);
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0ms !important;
    scroll-behavior: auto !important;
  }

  .btn--primary:hover,
  .btn--primary:active,
  .btn--secondary:active {
    transform: none;
  }

  .btn--primary:active {
    box-shadow: 0 0 0 var(--rule);
  }
}

/* ---------- Coming-soon landing page (index.html) ---------- */

.landing__main {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.75rem;
  min-height: 100vh;
  min-height: 100svh;
  padding: 2rem var(--gutter);
}

.landing__title {
  margin: 0;
}

/* The logo opens /preview/ on a triple click (script in index.html), so it
   must not look or behave like a link: no cursor change, no text selection. */
.landing__logo {
  display: block;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.landing__logo img {
  width: auto;
  height: clamp(48px, 12vw, 72px);
}

.landing__note {
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
