/* ============================================================
   Alan Barretto — personal site
   Concept: fine print production. Warm paper stock, editorial
   ink serif, spec-sheet mono, CMYK calibration marks.
   ============================================================ */

:root {
  --paper: #f5efe3;
  --paper-deep: #ece3d0;
  --ink: #211c15;
  --ink-soft: #5c5344;
  --rule: rgba(33, 28, 21, 0.18);
  --rule-strong: rgba(33, 28, 21, 0.55);
  --red: #b93a1b;
  --cyan: #0090c5;
  --magenta: #d40f6e;
  --yellow: #e8b50a;
  --ink-paper: #f5efe3;          /* paper tones used on ink sections */
  --ink-paper-soft: #beb4a1;
  --ink-rule: rgba(245, 239, 227, 0.22);
  --serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  --mono: "Spline Sans Mono", "SFMono-Regular", Consolas, monospace;
  --measure: 62ch;
  --pad: clamp(1.25rem, 5vw, 4rem);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-optical-sizing: auto;
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* paper grain + vignette */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 40;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");
}

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

a { color: inherit; }

a:focus-visible, .btn:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 3px;
}
.section-ink a:focus-visible, .section-ink .btn:focus-visible {
  outline-color: var(--yellow);
}

/* ---------------- masthead ---------------- */

.masthead {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem var(--pad);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  white-space: nowrap;
}

.regmark { width: 18px; height: 18px; flex: none; }

.masthead-nav {
  display: flex;
  gap: clamp(0.9rem, 2.5vw, 2rem);
  overflow-x: auto;
  scrollbar-width: none;
}
.masthead-nav::-webkit-scrollbar { display: none; }

.masthead-nav a {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink-soft);
  padding: 0.2rem 0;
  border-bottom: 1px solid transparent;
  transition: color 0.2s, border-color 0.2s;
  white-space: nowrap;
}
.masthead-nav a:hover { color: var(--red); border-bottom-color: var(--red); }

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

.hero { padding: clamp(2.5rem, 6vh, 5rem) var(--pad) 0; }

.folio {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-soft);
  border-top: 1px solid var(--rule-strong);
  border-bottom: 1px solid var(--rule);
  padding: 0.55rem 0;
  margin-bottom: clamp(2rem, 5vh, 3.5rem);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 4fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: start;
}

h1 {
  font-size: clamp(2.4rem, 5.4vw, 4.4rem);
  font-weight: 380;
  line-height: 1.06;
  letter-spacing: -0.015em;
  text-wrap: balance;
  max-width: 15ch;
}

.lede {
  margin-top: 1.75rem;
  max-width: var(--measure);
  font-size: clamp(1.1rem, 1.6vw, 1.3rem);
  line-height: 1.55;
  color: var(--ink-soft);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: 2.25rem;
}

.btn {
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 0.85rem 1.4rem;
  border: 1px solid var(--ink);
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.btn-ink { background: var(--ink); color: var(--paper); }
.btn-ink:hover { background: var(--red); border-color: var(--red); }
.btn-line { background: transparent; color: var(--ink); }
.btn-line:hover { border-color: var(--red); color: var(--red); }
.btn-paper { background: var(--ink-paper); color: var(--ink); border-color: var(--ink-paper); }
.btn-paper:hover { background: var(--red); border-color: var(--red); color: var(--ink-paper); }

/* hero figure */

.hero-fig {
  border: 1px solid var(--rule);
  background: color-mix(in srgb, var(--paper-deep) 55%, var(--paper));
  padding: clamp(1rem, 2vw, 1.75rem);
}

.hero-fig svg { display: block; width: 100%; height: auto; }

.fig-ink { stroke: var(--ink); fill: var(--ink); }
.fig-ink [fill="none"], .fig-ink line, .fig-ink path { fill: none; }
.fig-ink circle[r="2.5"] { fill: var(--ink); }
.fig-red { stroke: var(--red); }
.fig-red [fill="none"] { fill: none; }
.fig-red circle[r="2.5"] { fill: var(--red); }
.fig-lead { stroke: var(--rule-strong); fill: none; stroke-width: 0.75; }

.fig-label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  fill: var(--ink-soft);
}
.fig-label-red { fill: var(--red); }

.spin {
  animation: spin 46s linear infinite;
  transform-origin: center;
  transform-box: fill-box;
}
.spin.slow { animation-duration: 72s; animation-direction: reverse; }

@keyframes spin { to { transform: rotate(360deg); } }

/* stat strip */

.stat-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--rule-strong);
  margin-top: clamp(2.5rem, 6vh, 4.5rem);
}

.stat-strip > div {
  padding: 1.4rem 1.25rem 1.6rem 0;
  border-right: 1px solid var(--rule);
}
.stat-strip > div:not(:first-child) { padding-left: 1.25rem; }
.stat-strip > div:last-child { border-right: none; }

.stat-strip dt {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.stat-strip dd {
  font-size: clamp(2.2rem, 3.6vw, 3.2rem);
  font-weight: 340;
  font-style: italic;
  line-height: 1.1;
  margin-top: 0.35rem;
}

/* ---------------- cmyk strip ---------------- */

.cmyk-strip {
  display: flex;
  height: 8px;
  width: min(280px, 40%);
  margin: clamp(3rem, 7vh, 5rem) var(--pad) 0;
}
.cmyk-strip i { flex: 1; }
.cmyk-strip .c { background: var(--cyan); }
.cmyk-strip .m { background: var(--magenta); }
.cmyk-strip .y { background: var(--yellow); }
.cmyk-strip .k { background: var(--ink); }
.cmyk-strip .r { background: var(--red); }

.footer .cmyk-strip { margin: 0; width: 100%; }

/* ---------------- sections ---------------- */

.section { padding: clamp(3.5rem, 9vh, 7rem) var(--pad); scroll-margin-top: 3.5rem; }

.section-head { margin-bottom: clamp(2.5rem, 6vh, 4rem); }

.kicker {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 1.1rem;
}

h2 {
  font-size: clamp(1.9rem, 3.6vw, 3rem);
  font-weight: 380;
  line-height: 1.12;
  letter-spacing: -0.01em;
  text-wrap: balance;
  max-width: 24ch;
}

.section-sub {
  margin-top: 1rem;
  color: var(--ink-soft);
  max-width: var(--measure);
}

/* crop marks on section heads */
.section-head { position: relative; }
.section-head::before {
  content: "";
  position: absolute;
  top: -1.4rem;
  left: 0;
  width: 14px;
  height: 14px;
  border-top: 1px solid var(--rule-strong);
  border-left: 1px solid var(--rule-strong);
}

/* ---------------- profile ---------------- */

.profile-grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 4fr);
  gap: clamp(2.5rem, 5vw, 5.5rem);
  align-items: start;
}

.prose p {
  max-width: var(--measure);
  margin-bottom: 1.4rem;
  font-size: 1.125rem;
  line-height: 1.7;
}
.prose p:last-child { margin-bottom: 0; }
.prose em { font-style: italic; }

.dropcap {
  float: left;
  font-size: 4.4rem;
  line-height: 0.82;
  font-weight: 420;
  padding: 0.08em 0.12em 0 0;
  color: var(--red);
}

.profile-aside {
  display: grid;
  gap: 1.25rem;
  position: sticky;
  top: 5.5rem;
}

.spec-card {
  border: 1px solid var(--rule);
  padding: 1.4rem 1.5rem 1.5rem;
  background: color-mix(in srgb, var(--paper-deep) 40%, var(--paper));
}

.spec-title {
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--rule);
  padding-bottom: 0.7rem;
  margin-bottom: 0.9rem;
}

.spec-list { list-style: none; }
.spec-list li {
  font-size: 0.95rem;
  line-height: 1.45;
  padding: 0.45rem 0;
}
.spec-list li + li { border-top: 1px dashed var(--rule); }
.spec-list span {
  display: block;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  color: var(--red);
  margin-bottom: 0.15rem;
}

.spec-tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.spec-tags li {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  padding: 0.35rem 0.65rem;
  border: 1px solid var(--rule-strong);
  border-radius: 999px;
}

/* ---------------- timeline ---------------- */

.timeline {
  list-style: none;
  max-width: 62rem;
  border-top: 1px solid var(--rule-strong);
}

.timeline li {
  display: grid;
  grid-template-columns: minmax(5.5rem, 9rem) 1fr;
  gap: clamp(1.25rem, 4vw, 3.5rem);
  padding: clamp(1.5rem, 3vh, 2.25rem) 0;
  border-bottom: 1px solid var(--rule);
}

.tl-year {
  font-style: italic;
  font-weight: 330;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  line-height: 1;
  color: var(--red);
}

.tl-body h3 {
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.tl-body p {
  max-width: var(--measure);
  color: var(--ink-soft);
}

/* ---------------- ink (dark) sections ---------------- */

.section-ink {
  background: var(--ink);
  color: var(--ink-paper);
}
.section-ink .kicker { color: var(--yellow); }
.section-ink .section-sub { color: var(--ink-paper-soft); }
.section-ink .section-head::before { border-color: var(--ink-rule); }

.pillars {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border: 1px solid var(--ink-rule);
}

.pillar {
  padding: clamp(1.75rem, 3vw, 2.5rem);
  border-right: 1px solid var(--ink-rule);
  position: relative;
}
.pillar:last-child { border-right: none; }

.pillar-no {
  font-style: italic;
  font-size: 2.4rem;
  font-weight: 320;
  color: var(--yellow);
  display: block;
  margin-bottom: 1.1rem;
}

.pillar h3 {
  font-size: 1.45rem;
  font-weight: 420;
  line-height: 1.2;
  margin-bottom: 0.9rem;
  text-wrap: balance;
}

.pillar p {
  color: var(--ink-paper-soft);
  font-size: 0.98rem;
  margin-bottom: 1.4rem;
}

.pillar blockquote {
  font-style: italic;
  font-size: 1.02rem;
  line-height: 1.5;
  border-left: 2px solid var(--yellow);
  padding-left: 0.9rem;
}

/* ---------------- press clippings ---------------- */

.clippings {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.clip {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  text-decoration: none;
  border: 1px solid var(--rule);
  background: color-mix(in srgb, var(--paper-deep) 35%, var(--paper));
  padding: 1.6rem 1.6rem 1.5rem;
  transition: border-color 0.25s, transform 0.25s, box-shadow 0.25s;
}

.clip:hover {
  border-color: var(--ink);
  transform: translateY(-3px);
  box-shadow: 0 14px 30px -18px rgba(33, 28, 21, 0.45);
}

.clip-pub {
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--red);
}

.clip blockquote {
  font-size: 1.18rem;
  font-weight: 360;
  font-style: italic;
  line-height: 1.42;
  flex: 1;
}

.clip-title {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  line-height: 1.5;
  color: var(--ink-soft);
  border-top: 1px dashed var(--rule);
  padding-top: 0.9rem;
  transition: color 0.2s;
}
.clip:hover .clip-title { color: var(--ink); }

/* ---------------- connect ---------------- */

.section-connect { text-align: center; }

.connect-inner {
  max-width: 44rem;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.section-connect h2 { max-width: none; }

.section-connect p {
  margin-top: 1.5rem;
  color: var(--ink-paper-soft);
  font-size: 1.08rem;
}

.section-connect .hero-actions { justify-content: center; }

.connect-loc {
  font-family: var(--mono);
  font-size: 0.7rem !important;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  margin-top: 2.4rem !important;
}

/* ---------------- footer ---------------- */

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

.footer-inner {
  padding: 2.25rem var(--pad) 2.75rem;
  display: grid;
  gap: 0.45rem;
}

.footer-name {
  font-family: var(--mono);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.footer-meta, .footer-colophon {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  color: var(--ink-soft);
}

.footer-meta a { color: var(--red); text-decoration: none; }
.footer-meta a:hover { text-decoration: underline; }

.footer-colophon { font-style: normal; opacity: 0.75; margin-top: 0.6rem; }

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

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.d1 { transition-delay: 0.08s; }
.reveal.d2 { transition-delay: 0.16s; }
.reveal.d3 { transition-delay: 0.24s; }
.reveal.in-view { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .spin { animation: none; }
}

/* ---------------- responsive ---------------- */

@media (max-width: 920px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-fig { max-width: 26rem; }
  .stat-strip { grid-template-columns: repeat(2, 1fr); }
  .stat-strip > div { border-right: none; border-bottom: 1px solid var(--rule); padding-left: 0 !important; }
  .profile-grid { grid-template-columns: 1fr; }
  .profile-aside { position: static; }
  .pillars { grid-template-columns: 1fr; }
  .pillar { border-right: none; border-bottom: 1px solid var(--ink-rule); }
  .pillar:last-child { border-bottom: none; }
  .clippings { grid-template-columns: 1fr; }
}

@media (min-width: 1700px) {
  .masthead, .hero, .section, .footer-inner {
    padding-inline: calc((100vw - 100rem) / 2 + 4rem);
  }
  .cmyk-strip { margin-inline: calc((100vw - 100rem) / 2 + 4rem); }
}

@media (max-width: 640px) {
  .masthead { flex-direction: column; align-items: flex-start; gap: 0.6rem; }
  .masthead-nav { width: 100%; justify-content: space-between; gap: 0.5rem; }
  .masthead-nav a { font-size: 0.58rem; letter-spacing: 0.06em; }
  .section { scroll-margin-top: 6.5rem; }
  .timeline li { grid-template-columns: 1fr; gap: 0.5rem; }
  h1 { max-width: none; }
}
