/* ===========================================================
   Joel Wish — shared styles
   Content-first (Ben Lang / benlang.me aesthetic): warm near-black
   text on white, clean Inter sans, generous whitespace, with a
   muted Notion-green accent for links and highlights.
   =========================================================== */

/* Inter is loaded via <link> in each page's <head> (faster than @import). */

:root {
  --bg:      #ffffff;
  --surface: #ffffff;
  --ink:     #37352f;
  --muted:   #787774;
  --faint:   #9b9a97;
  /* accent — bright, fresh green for links, icons and highlights */
  --green:   #15a34a;
  --green-2: #0e7a39;
  --line:    rgba(55, 53, 47, 0.16);
  --line-soft: rgba(55, 53, 47, 0.09);

  /* one sans for everything, Ben Lang style */
  --serif: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --sans:  'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --maxw: 1080px;
  --gap:  clamp(1.5rem, 4vw, 3.5rem);
}

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

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

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  letter-spacing: -0.006em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: 'cv05' 1, 'cv11' 1, 'ss01' 1;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }

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

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gap); }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: saturate(150%) blur(10px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid var(--line-soft);
}
.nav__inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.nav__mark {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}
.nav__links { display: flex; gap: clamp(1rem, 3vw, 2rem); align-items: center; }
.nav__links a {
  font-size: 0.9rem; font-weight: 500; color: var(--muted);
  position: relative; transition: color .25s ease;
}
.nav__links a:hover { color: var(--ink); }
.nav__links a.cta {
  color: var(--green);
}
.nav__links a.cta::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -3px;
  height: 1.5px; background: var(--green);
  transform: scaleX(0); transform-origin: left; transition: transform .3s ease;
}
.nav__links a.cta:hover::after { transform: scaleX(1); }
@media (max-width: 620px) {
  .nav__links a.plain { display: none; }
}

/* ---------- reveal animation base (CSS-driven, no rAF dependency) ---------- */
[data-reveal] {
  opacity: 0; transform: translateY(18px);
  transition: opacity .9s cubic-bezier(.2,.7,.2,1), transform .9s cubic-bezier(.2,.7,.2,1);
  will-change: opacity, transform;
}
[data-reveal].is-in { opacity: 1; transform: none; }
.no-js [data-reveal] { opacity: 1; transform: none; transition: none; }
@media (prefers-reduced-motion: reduce) {
  [data-reveal] { transition: none; opacity: 1; transform: none; }
}

/* ---------- hero ---------- */
.hero { padding: clamp(3.5rem, 9vw, 7rem) 0 clamp(2.5rem, 6vw, 4.5rem); }
.hero__grid {
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}
@media (max-width: 820px) {
  .hero__grid { grid-template-columns: 1fr; gap: 2.5rem; }
}

.portrait {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background: linear-gradient(150deg, #e8e8e8, #d2d2d2);
  aspect-ratio: 4 / 5;
  box-shadow: 0 30px 60px -30px rgba(20,32,26,0.45);
}
.portrait img { width: 100%; height: 100%; object-fit: cover; display: block; }
.portrait__ph {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: rgba(0,0,0,0.4); font-size: 0.85rem; letter-spacing: 0.08em; text-transform: uppercase;
  text-align: center; padding: 1rem;
}

.eyebrow {
  font-size: 0.78rem; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--green); margin-bottom: 1.25rem;
}
.hero h1 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(2.2rem, 5.2vw, 3.6rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin-bottom: 1.6rem;
}
.hero h1 em { font-style: normal; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }

/* about links list */
.about { margin-top: 1.9rem; border-top: 1px solid var(--line); padding-top: 1.4rem; }
.about__label {
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--faint); margin-bottom: 0.9rem;
}
.about ul { list-style: none; display: grid; gap: 0.55rem; }
.about li a {
  display: inline-flex; align-items: center; gap: 0.7rem;
  font-size: 1.02rem; font-weight: 500; color: var(--green);
  width: fit-content; transition: color .2s ease;
}
.about li a .ic { width: 1.35em; flex: none; display: inline-grid; place-items: center; }
.about li a .ic svg { width: 1.15em; height: 1.15em; display: block; }
.about li a .txt { position: relative; }
.about li a .txt::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 1.5px;
  background: var(--green); transform: scaleX(0); transform-origin: left; transition: transform .28s ease;
}
.about li a:hover { color: var(--green-2); }
.about li a:hover .txt::after { transform: scaleX(1); }

/* ---------- Why I started — feature banner ---------- */
.feature {
  margin: clamp(2rem, 5vw, 3.5rem) 0;
}
.feature__card {
  display: flex; align-items: center; justify-content: space-between; gap: 2rem;
  background: var(--green);
  color: #f3f6f2;
  border-radius: 16px;
  padding: clamp(1.6rem, 4vw, 2.6rem) clamp(1.6rem, 4vw, 2.8rem);
  position: relative; overflow: hidden;
  transition: transform .35s cubic-bezier(.2,.7,.2,1), box-shadow .35s ease;
  box-shadow: 0 24px 50px -30px rgba(0,0,0,0.55);
}
.feature__card:hover { transform: translateY(-3px); box-shadow: 0 34px 60px -30px rgba(0,0,0,0.6); }
.feature__card::after {
  content: ""; position: absolute; right: -60px; top: -60px; width: 240px; height: 240px;
  background: radial-gradient(circle, rgba(255,255,255,0.12), transparent 70%);
}
.feature__txt h3 {
  font-family: var(--serif); font-weight: 600; font-size: clamp(1.4rem, 3vw, 2rem);
  line-height: 1.15; margin-bottom: 0.4rem; letter-spacing: -0.02em;
}
.feature__txt p { color: rgba(243,246,242,0.72); font-size: 0.98rem; max-width: 46ch; }
.feature__arrow {
  flex: none; width: 52px; height: 52px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.35);
  display: grid; place-items: center; font-size: 1.3rem;
  transition: background .3s ease, transform .3s ease;
}
.feature__card:hover .feature__arrow { background: rgba(255,255,255,0.14); transform: translateX(4px); }
@media (max-width: 560px) {
  .feature__card { flex-direction: column; align-items: flex-start; gap: 1.4rem; }
}

/* ---------- section heading ---------- */
.section { padding: clamp(2.5rem, 6vw, 4.5rem) 0; }
.section__head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 1rem;
  margin-bottom: 2rem; border-bottom: 1px solid var(--line); padding-bottom: 1rem;
}
.section__head h2 {
  font-family: var(--serif); font-weight: 600; font-size: clamp(1.6rem, 3.5vw, 2.3rem);
  letter-spacing: -0.02em;
}
.section__head a { font-size: 0.9rem; font-weight: 500; color: var(--green); white-space: nowrap; }
.section__head a:hover { text-decoration: underline; }

/* ---------- portfolio grid ---------- */
.folio {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 1px;
  background: var(--line-soft);
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  overflow: hidden;
}
.folio__item {
  background: var(--surface);
  padding: 1.25rem 1.3rem 1.35rem;
  display: flex; flex-direction: column; gap: 0.5rem;
  min-height: 120px;
  transition: background .25s ease;
}
.folio__item:hover { background: #fff; }
.folio__item .co {
  font-family: var(--serif); font-size: 1.12rem; font-weight: 500; letter-spacing: -0.01em;
  display: inline-flex; align-items: center; gap: 0.4rem;
}
.folio__item .co .ext { font-size: 0.7em; color: var(--faint); transition: transform .2s ease; }
.folio__item a.co:hover .ext { transform: translate(2px,-2px); }
.folio__item .desc { font-size: 0.9rem; color: var(--muted); line-height: 1.45; }
.folio__item .tag {
  margin-top: auto;
  font-size: 0.7rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--green);
  background: color-mix(in srgb, var(--green) 10%, transparent);
  width: fit-content; padding: 0.2rem 0.55rem; border-radius: 999px;
}
.folio__state {
  grid-column: 1 / -1; background: var(--surface);
  padding: 2.5rem 1.5rem; text-align: center; color: var(--muted); font-size: 0.95rem;
}
.folio__state .skeleton-row { display: inline-block; }
.folio.loading .folio__item { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%,100%{opacity:.55} 50%{opacity:1} }

.folio-note { margin-top: 1rem; font-size: 0.82rem; color: var(--faint); }
.folio-note a { color: var(--green); text-decoration: underline; }

/* ---------- footer ---------- */
.footer {
  border-top: 1px solid var(--line);
  padding: 2.5rem 0 3.5rem;
  margin-top: 1rem;
}
.footer__inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.footer__inner small { color: var(--faint); font-size: 0.85rem; }
.footer__links { display: flex; gap: 1.3rem; }
.footer__links a { font-size: 0.88rem; color: var(--muted); }
.footer__links a:hover { color: var(--green); }

/* ===========================================================
   Article (Why I started Bright Harbor)
   =========================================================== */
.article { padding: clamp(2.5rem, 6vw, 4.5rem) 0 1rem; }
.article__back {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-size: 0.9rem; color: var(--muted); margin-bottom: 2rem; transition: gap .2s ease, color .2s ease;
}
.article__back:hover { color: var(--green); gap: 0.7rem; }
.article__head { max-width: 760px; margin: 0 auto; text-align: center; }
.article__head .eyebrow { text-align: center; }
.article__head h1 {
  font-family: var(--serif); font-weight: 600; letter-spacing: -0.025em;
  font-size: clamp(2.1rem, 5.5vw, 3.4rem); line-height: 1.1; margin-bottom: 1rem;
}
.article__head .dek { font-size: 1.15rem; color: var(--muted); max-width: 60ch; margin: 0 auto; }
.article__meta {
  margin-top: 1.6rem; font-size: 0.85rem; color: var(--faint);
  display: flex; gap: 1rem; justify-content: center; align-items: center;
}
.article__hero {
  margin: clamp(2rem, 5vw, 3.5rem) auto 0;
  max-width: 920px; border-radius: 16px; overflow: hidden;
  aspect-ratio: 16 / 9; background: linear-gradient(150deg, #e8e8e8, #d2d2d2);
  position: relative;
}
.article__hero img { width: 100%; height: 100%; object-fit: cover; display: block; }

.prose { max-width: 680px; margin: clamp(2.2rem, 5vw, 3.4rem) auto 0; }
.prose p { margin-bottom: 1.45rem; color: var(--ink); }
.prose a {
  color: var(--green); text-decoration: underline;
  text-decoration-thickness: 1.5px; text-underline-offset: 2px;
  transition: color .2s ease;
}
.prose a:hover { color: var(--green-2); }
.prose p:first-of-type::first-letter {
  font-family: var(--serif); font-size: 3.2rem; line-height: 0.8; float: left;
  padding: 0.08em 0.12em 0 0; color: var(--green); font-weight: 500;
}
.prose h2 {
  font-family: var(--serif); font-weight: 600; font-size: 1.6rem; letter-spacing: -0.02em;
  margin: 2.4rem 0 1rem;
}
.prose blockquote {
  border-left: 3px solid var(--green); padding-left: 1.2rem; margin: 1.8rem 0;
  font-family: var(--serif); font-size: 1.35rem; font-style: italic; line-height: 1.4; color: var(--ink);
}
.prose figure { margin: 2.2rem 0; }
.prose figure .ph, .prose figure img {
  width: 100%; border-radius: 12px; display: block;
  aspect-ratio: 3 / 2; object-fit: cover;
  background: linear-gradient(150deg, #e8e8e8, #d2d2d2);
}
.prose figure .ph { display: grid; place-items: center; color: rgba(0,0,0,0.4); font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase; }
.prose figcaption { margin-top: 0.6rem; font-size: 0.85rem; color: var(--faint); text-align: center; }
.prose .twoup { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 2.2rem 0; }
.prose .twoup figure { margin: 0; }
@media (max-width: 560px) { .prose .twoup { grid-template-columns: 1fr; } }
