/* ==========================================================================
   Marc García Martínez — marcgarciamartinez.com
   Single stylesheet. No framework, no build step.
   ========================================================================== */

:root {
  --bg: #F7F4EE;
  --ink: #14120E;
  --ink-soft: #3A362E;
  --muted: #6B665C;
  --faint: #9A9488;
  --rule: rgba(20, 18, 14, 0.14);
  --accent: #EFB01F;

  --dark: #14120E;
  --on-dark: #F7F4EE;
  --on-dark-muted: #B9B4AA;
  --rule-dark: rgba(247, 244, 238, 0.25);

  --serif: Newsreader, Georgia, "Times New Roman", serif;
  --sans: "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --gutter: clamp(20px, 6vw, 80px);
  --page: 1120px;
}

/* --------------------------------------------------------------- reset -- */

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

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

a { color: inherit; }

h1, h2, h3, p { margin: 0; }

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 10;
  padding: 12px 20px;
  background: var(--ink);
  color: var(--on-dark);
  font-size: 14px;
  text-decoration: none;
}
.skip-link:focus { left: 0; }

/* ------------------------------------------------------------- layout -- */

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

.rule-top { border-top: 1px solid var(--rule); }

/* Two-column editorial grid used throughout the case study and About. */
.cols {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
}

@media (min-width: 720px) {
  .cols { grid-template-columns: 1fr 1fr; gap: 56px; }
}

.cols--start { align-items: start; }

/* ------------------------------------------------------------ typography */

.label {
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.mono { font-family: var(--mono); }

.lede {
  font-size: clamp(1rem, 2.2vw, 1.1875rem);
  line-height: 1.6;
  color: var(--ink-soft);
}

.h-display {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(3rem, 11vw, 7.375rem);
  line-height: 0.92;
  letter-spacing: -0.035em;
}

.h-section {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2rem, 5vw, 2.75rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.h-case {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2rem, 5vw, 3.25rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
  max-width: 20ch;
  margin-bottom: clamp(32px, 5vw, 56px);
}

/* Marker-pen highlight behind the thesis sentence. */
.mark {
  background: linear-gradient(transparent 62%, color-mix(in srgb, var(--accent) 40%, transparent) 0);
}

/* --------------------------------------------------------------- buttons */

.btn {
  display: inline-block;
  padding: 14px 24px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease;
}

.btn--solid { background: var(--ink); color: var(--bg); }
.btn--solid:hover { background: var(--accent); color: var(--ink); }

.btn--ghost { border-color: rgba(20, 18, 14, 0.2); color: var(--ink); }
.btn--ghost:hover { border-color: var(--ink); }

.btn--accent {
  padding: 15px 26px;
  background: var(--accent);
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
}
.btn--accent:hover { background: var(--ink); color: var(--bg); }

.btn--on-dark { border-color: var(--rule-dark); color: var(--on-dark); }
.btn--on-dark:hover { background: var(--accent); border-color: var(--accent); color: var(--ink); }

/* Understated underlined text link. */
.link-quiet {
  align-self: flex-start;
  font-size: 14px;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid rgba(20, 18, 14, 0.2);
  padding-bottom: 3px;
  transition: color 160ms ease, border-color 160ms ease;
}
.link-quiet:hover { color: var(--ink); border-color: var(--ink); }

/* ---------------------------------------------------------------- header */

.site-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px 24px;
  padding-block: clamp(20px, 3vw, 32px);
  font-size: 13px;
  color: var(--muted);
}

.site-header__brand {
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
  letter-spacing: 0.02em;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 26px;
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
  transition: color 160ms ease;
}
.site-nav a:hover { color: var(--ink); }

/* ------------------------------------------------------------------ hero */

.hero { padding-block: clamp(32px, 5vw, 60px) clamp(40px, 6vw, 72px); }

.hero__byline {
  display: flex;
  align-items: center;
  gap: 18px;
  padding-bottom: clamp(24px, 4vw, 36px);
}

.hero__avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  flex: none;
  background: rgba(20, 18, 14, 0.06);
}

.hero__name { font-size: 15px; letter-spacing: 0.02em; }

.hero__foot {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  padding-top: clamp(28px, 4vw, 44px);
  align-items: end;
}

.hero__tagline {
  font-family: var(--serif);
  font-size: clamp(1.375rem, 3.4vw, 1.625rem);
  line-height: 1.4;
  font-style: italic;
  font-weight: 300;
  color: var(--ink-soft);
}

.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; }

@media (min-width: 720px) {
  .hero__foot { grid-template-columns: 1fr 1fr; gap: 64px; }
  .hero__actions { justify-content: flex-end; }
}

/* Fact strip under the hero. */
.facts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  padding-block: 22px;
  border-block: 1px solid var(--rule);
  font-size: 14px;
  color: var(--muted);
  list-style: none;
  margin: 0;
}

.facts li { display: flex; align-items: center; gap: 22px; }
.facts li:not(:last-child)::after { content: "·"; color: #C4BEB2; }

/* ------------------------------------------------------- case study --- */

.case { padding-top: clamp(56px, 9vw, 96px); }

.case__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px 40px;
  padding-bottom: clamp(28px, 4vw, 44px);
}

.case__logo { width: clamp(180px, 24vw, 246px); }

.case__block { padding-block: clamp(32px, 4vw, 44px); }

.stack { display: flex; flex-direction: column; gap: 14px; }
.stack--wide { gap: 18px; }

/* 16:9 video frame. */
.video {
  position: relative;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--rule);
  border-radius: 6px;
  overflow: hidden;
  background-color: var(--dark);
  background-image: repeating-linear-gradient(
    135deg,
    rgba(247, 244, 238, 0.05) 0 10px,
    transparent 10px 20px
  );
}

.video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Proof numbers. */
.stats {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px 40px;
  padding-block: clamp(32px, 4vw, 44px);
}

.stat { display: flex; flex-direction: column; gap: 8px; }

.stat__value {
  font-family: var(--serif);
  font-size: clamp(2.75rem, 6vw, 3.625rem);
  line-height: 1;
  letter-spacing: -0.04em;
}
.stat__value--accent { color: var(--accent); }

.stat__label { font-size: 13px; letter-spacing: 0.06em; color: var(--muted); }

.stats__note { grid-column: 1 / -1; font-size: 16px; color: var(--ink-soft); }

@media (min-width: 720px) {
  .stats { grid-template-columns: repeat(3, 1fr); }
}

.case__pull {
  font-family: var(--serif);
  font-size: clamp(1.375rem, 3.2vw, 1.6875rem);
  line-height: 1.4;
  letter-spacing: -0.015em;
}

.case__solo-side {
  display: flex;
  flex-direction: column;
  gap: 22px;
  align-items: flex-start;
}

.case__block--last { padding-bottom: clamp(48px, 6vw, 64px); }

.case__tech { font-size: 13px; color: var(--muted); }

/* ----------------------------------------------------------------- about */

.about { padding-top: clamp(24px, 4vw, 40px); }

.about__block { padding-block: clamp(32px, 4vw, 44px) clamp(32px, 4vw, 40px); }

.timeline { display: flex; flex-direction: column; }

.timeline__row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px 20px;
  padding-block: 16px;
  border-bottom: 1px solid var(--rule);
}

.timeline__when { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.timeline__what { font-size: 17px; }

@media (min-width: 480px) {
  .timeline__row { grid-template-columns: 130px 1fr; align-items: baseline; }
}

.about__link { margin-top: 24px; }

/* ------------------------------------------------------------------ blog */

.blog { padding-bottom: clamp(56px, 9vw, 96px); }

.blog__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px 24px;
  padding-block: clamp(32px, 4vw, 44px) 28px;
}

.post-list { display: flex; flex-direction: column; }

.post-link {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 8px 24px;
  align-items: baseline;
  padding: 26px 0;
  border-top: 1px solid var(--rule);
  color: inherit;
  text-decoration: none;
  transition: background-color 160ms ease;
}
.post-link:last-child { border-bottom: 1px solid var(--rule); }
.post-link:hover { background: color-mix(in srgb, var(--accent) 8%, transparent); }

.post-link__index { font-family: var(--mono); font-size: 13px; color: var(--muted); }

.post-link__title {
  font-family: var(--serif);
  font-size: clamp(1.375rem, 3.6vw, 1.875rem);
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.post-link__cta {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
  grid-column: 2;
}

@media (min-width: 720px) {
  .post-link { grid-template-columns: 48px 1fr 140px; }
  .post-link__cta { grid-column: auto; text-align: right; }
}

/* --------------------------------------------------------------- contact */

.contact {
  background: var(--dark);
  color: var(--on-dark);
}

.contact__inner {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding-block: clamp(56px, 9vw, 96px);
}

.contact h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.75rem, 8vw, 5.5rem);
  line-height: 1;
  letter-spacing: -0.035em;
}

.contact__text {
  max-width: 44ch;
  font-size: clamp(1rem, 2.4vw, 1.25rem);
  line-height: 1.55;
  color: var(--on-dark-muted);
}

.contact__actions { display: flex; flex-wrap: wrap; gap: 14px; padding-top: 10px; }

.contact__copyright {
  padding-top: clamp(24px, 4vw, 34px);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ------------------------------------------------------------ blog post */

.post { padding-block: clamp(40px, 7vw, 88px) clamp(56px, 9vw, 96px); }

.post__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  padding-bottom: 24px;
}

.post__title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.25rem, 7vw, 4rem);
  line-height: 1.05;
  letter-spacing: -0.035em;
  max-width: 18ch;
}

.post__body {
  max-width: 62ch;
  padding-top: clamp(28px, 4vw, 44px);
  margin-top: clamp(28px, 4vw, 44px);
  border-top: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.post__body p { font-size: clamp(1rem, 2.2vw, 1.1875rem); line-height: 1.6; color: var(--ink-soft); }

.post__back { margin-top: clamp(32px, 5vw, 48px); }

/* --------------------------------------------------------------- 404 --- */

.notfound {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
  padding-block: clamp(72px, 14vw, 160px);
}

/* ------------------------------------------------------------- reveal --- */

/* Hidden only when JS is running, so the page is fully readable without it. */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 700ms cubic-bezier(0.22, 0.61, 0.36, 1),
              transform 700ms cubic-bezier(0.22, 0.61, 0.36, 1);
}

.js [data-reveal].is-revealed {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  .js [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }

  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
