/* ------------------------------------------------------------------
   Alcamob — alcamob.com
   Visual system derived from the logo: near-black ink, a single
   periwinkle accent, and the diagonal cut used as a restrained motif.
   ------------------------------------------------------------------ */

:root {
  --bg: #f7f8fa;            /* slightly cool off-white */
  --ink: #222630;           /* logo near-black */
  --ink-soft: #5d6470;      /* secondary text, 5.6:1 on --bg */
  --accent: #7184d9;        /* logo periwinkle — large type, rules, hover */
  --accent-text: #4a5fc6;   /* same hue, deepened for small text, 5.3:1 on --bg */
  --rule: #d9dce3;          /* fine hairlines */

  --font: "Instrument Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --container: 72rem;
  --gutter: clamp(1.25rem, 5vw, 3.5rem);

  /* The logo's cut runs at roughly this angle; reused for slanted ends on rules. */
  --cut: 12px;

  --ease-out: cubic-bezier(0.2, 0.7, 0.2, 1);
}

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

html {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 100%;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: clip;
}

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

h1, h2, h3, p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Focus — clearly visible on every interactive element */
:focus-visible {
  outline: 2px solid var(--accent-text);
  outline-offset: 4px;
  border-radius: 2px;
}

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

/* Skip link */
.skip-link {
  position: absolute;
  top: 0; left: var(--gutter);
  transform: translateY(-120%);
  padding: 0.5rem 0.75rem;
  background: var(--ink);
  color: #fff;
  font-weight: 500;
  text-decoration: none;
  z-index: 10;
  transition: transform 150ms var(--ease-out);
}
.skip-link:focus { transform: translateY(0.75rem); outline-color: var(--accent); }

/* ------------------------------------------------------------------
   Links — hover underline draws in from the left in the accent colour
   ------------------------------------------------------------------ */
.link {
  position: relative;
  display: inline-block;
  color: var(--ink);
  font-weight: 500;
  text-decoration: none;
  /* Comfortable touch target (short labels like "X" are otherwise ~10px wide);
     the negative margin keeps the text exactly where it was. */
  padding: 0.5rem 0.5rem;
  margin: -0.25rem -0.5rem;
}
.link::after {
  content: "";
  position: absolute;
  left: 0.5rem; right: 0.5rem; bottom: 0.35rem;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 220ms var(--ease-out);
}
.link:hover::after,
.link:focus-visible::after { transform: scaleX(1); }
.link:hover { color: var(--accent-text); }

.link--large { font-size: clamp(1.25rem, 2.2vw, 1.5rem); font-weight: 500; }
.link--large::after { bottom: 0.4rem; }

/* ------------------------------------------------------------------
   Header
   ------------------------------------------------------------------ */
.site-header { padding-block: clamp(1.25rem, 3vw, 2rem); }

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand {
  display: inline-block;
  /* Clear space: at least the height of the wordmark's x-height on all sides */
  padding: 0.5rem 0.5rem 0.5rem 0;
  flex-shrink: 0;
}
.brand__wordmark {
  width: 148px;
  height: auto;
}

.social__list {
  display: flex;
  gap: clamp(1rem, 3vw, 2rem);
  align-items: center;
  font-size: 0.9375rem;
}

@media (max-width: 480px) {
  .brand__wordmark { width: 120px; }
  .social__list { font-size: 0.875rem; gap: 1rem; }
}
/* Very narrow screens: social links drop to a second row rather than shrinking or clipping */
@media (max-width: 380px) {
  .site-header { padding-block: 1rem 0.75rem; }
  .site-header__inner { flex-wrap: wrap; row-gap: 0.25rem; }
  .social { flex-basis: 100%; }
  .social__list { font-size: 0.9375rem; gap: 1.5rem; }
}

/* ------------------------------------------------------------------
   Hero
   ------------------------------------------------------------------ */
.hero {
  padding-block: clamp(4rem, 12vw, 9rem) clamp(4rem, 10vw, 8rem);
}

.slogan {
  display: flex;
  flex-direction: column;
  font-weight: 600;
  font-size: clamp(3.5rem, 13vw, 10.5rem);
  line-height: 0.95;
  letter-spacing: -0.035em;
  margin-left: -0.04em; /* optical alignment of the round B against the grid */
}

.slogan__word {
  display: inline-block;
  width: max-content;
  max-width: 100%;
}

.slogan__word--evolve { color: var(--accent); }

.hero__copy {
  margin-top: clamp(2.5rem, 6vw, 4.5rem);
  max-width: 34rem;
  display: grid;
  gap: 1.25rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  position: relative;
}
/* Slanted accent cap on the hairline — nods to the logo's cut without copying it */
.hero__copy::before {
  content: "";
  position: absolute;
  top: -1px; left: 0;
  width: 3.5rem; height: 3px;
  background: var(--accent);
  clip-path: polygon(0 0, 100% 0, calc(100% - var(--cut)) 100%, 0 100%);
}

.hero__lead,
.hero__body { text-wrap: pretty; }

.hero__lead {
  font-size: clamp(1.25rem, 2.4vw, 1.625rem);
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: -0.01em;
}
.hero__body {
  font-size: clamp(1rem, 1.5vw, 1.125rem);
  color: var(--ink-soft);
  max-width: 30rem;
}

/* ------------------------------------------------------------------
   Principles — three numbered editorial statements.
   The numerals anchor each row; the statement runs wide beside them.
   ------------------------------------------------------------------ */
.principles {
  padding-block: clamp(3rem, 8vw, 6rem) clamp(4rem, 10vw, 8rem);
}

.section-label {
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: clamp(1.5rem, 4vw, 2.5rem);
}

.principles__list {
  display: grid;
  grid-template-columns: 1fr;
}

.principle {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  padding-block: clamp(2rem, 5vw, 3.5rem);
  border-top: 1px solid var(--ink);
}
/* Short slanted accent at the start of each rule */
.principle::before {
  content: "";
  position: absolute;
  top: -1px; left: 0;
  width: 2.25rem; height: 3px;
  background: var(--accent);
  clip-path: polygon(0 0, 100% 0, calc(100% - var(--cut)) 100%, 0 100%);
}

.principle__index {
  font-size: clamp(2.75rem, 7vw, 5rem);
  font-weight: 600;
  line-height: 0.9;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
}
.principle__text {
  font-size: clamp(1.25rem, 2.3vw, 1.875rem);
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: -0.015em;
  max-width: 34ch;
  text-wrap: pretty;
}

@media (min-width: 760px) {
  .principle {
    grid-template-columns: minmax(7rem, 1fr) minmax(0, 4fr);
    column-gap: clamp(2rem, 6vw, 5rem);
    align-items: start;
  }
  .principle__index { padding-top: 0.15em; }
  .principle__text { margin-left: auto; margin-right: min(8vw, 6rem); }
}
.principle:last-child { padding-bottom: 0; }

/* ------------------------------------------------------------------
   Contact — the page's primary call to action
   ------------------------------------------------------------------ */
.contact {
  position: relative;
  padding-block: clamp(4rem, 10vw, 8rem) clamp(4rem, 10vw, 8rem);
  border-top: 1px solid var(--rule);
}
.contact::before {
  content: "";
  position: absolute;
  top: -1px; left: 0;
  width: min(28vw, 18rem); height: 3px;
  background: var(--accent);
  clip-path: polygon(0 0, 100% 0, calc(100% - var(--cut)) 100%, 0 100%);
}

.contact__inner {
  display: grid;
  gap: clamp(2rem, 5vw, 3.5rem);
}

.contact__title,
.contact__lead {
  font-size: clamp(2.25rem, 6vw, 4.5rem);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.035em;
}
.contact__title { text-wrap: balance; }
.contact__lead { color: var(--accent); }

.contact__action { line-height: 1; }
.contact__email {
  display: inline-block;
  max-width: 100%;
  color: var(--ink);
  font-size: clamp(1.5rem, 4vw, 2.75rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.2;
  text-decoration: none;
  padding-bottom: 0.15em;
  border-bottom: 2px solid var(--ink);
  overflow-wrap: anywhere;
  word-break: normal;
  transition: color 180ms var(--ease-out), border-color 180ms var(--ease-out);
}
.contact__email:hover,
.contact__email:focus-visible {
  color: var(--accent-text);
  border-bottom-color: var(--accent);
}

@media (min-width: 760px) {
  .contact__inner { gap: clamp(2.5rem, 6vw, 4.5rem); }
  .contact__heading { max-width: 40rem; }
}

/* ------------------------------------------------------------------
   Footer
   ------------------------------------------------------------------ */
.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--rule);
  padding-block: clamp(3rem, 7vw, 5rem) clamp(2rem, 4vw, 3rem);
  position: relative;
}
/* Cropped colour field: a slim accent band whose leading edge is cut on the logo's diagonal */
.site-footer::before {
  content: "";
  position: absolute;
  top: -1px; right: 0;
  width: min(28vw, 18rem); height: 3px;
  background: var(--accent);
  clip-path: polygon(var(--cut) 0, 100% 0, 100% 100%, 0 100%);
}

.site-footer__inner {
  display: grid;
  gap: clamp(2.5rem, 6vw, 4rem);
}

.site-footer__title {
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: clamp(1.25rem, 3vw, 2rem);
  max-width: 20ch;
  text-wrap: balance;
}

.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem clamp(1.5rem, 4vw, 3rem);
}

.site-footer__contact {
  margin-top: clamp(0.75rem, 2vw, 1.25rem);
  font-size: clamp(1rem, 1.6vw, 1.125rem);
}

.site-footer__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  font-size: 0.875rem;
  color: var(--ink-soft);
}
.site-footer__symbol { width: 32px; height: auto; flex-shrink: 0; }

/* ------------------------------------------------------------------
   Motion — first-visit reveal of the slogan.
   Pure CSS so it also runs without JavaScript; content is always in
   the DOM and readable. JavaScript only adds `.is-return-visit` to
   skip the intro on repeat visits within a session.
   ------------------------------------------------------------------ */
@media (prefers-reduced-motion: no-preference) {
  html:not(.is-return-visit) .slogan__word--build {
    /* precise mask reveal, top to bottom */
    animation: reveal-mask 640ms var(--ease-out) 120ms both;
  }
  html:not(.is-return-visit) .slogan__word--ship {
    /* short, controlled horizontal entry */
    animation: reveal-slide 560ms var(--ease-out) 520ms both;
  }
  html:not(.is-return-visit) .slogan__word--evolve {
    /* resolves through a spacing transition */
    animation: reveal-track 720ms var(--ease-out) 900ms both;
  }
  html:not(.is-return-visit) .hero__copy {
    animation: reveal-fade 600ms var(--ease-out) 1400ms both;
  }
}

@keyframes reveal-mask {
  from { clip-path: inset(0 0 100% 0); opacity: 0.999; }
  to   { clip-path: inset(0 0 0 0); }
}
@keyframes reveal-slide {
  from { transform: translateX(-0.35em); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}
@keyframes reveal-track {
  from { letter-spacing: 0.04em; opacity: 0; }
  to   { letter-spacing: -0.035em; opacity: 1; }
}
@keyframes reveal-fade {
  from { opacity: 0; transform: translateY(0.5rem); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition-duration: 0.01ms !important;
  }
  .link::after { transform: scaleX(1); opacity: 0; }
  .link:hover::after, .link:focus-visible::after { opacity: 1; }
}
