/* ============================================================
   Anthony Samani — styles.css
   Palette: warm ink & cream, one restrained accent.
   Type: brand kit fonts — Inter (display/UI) + JetBrains Mono (labels).
   Logo: brand kit "Chamfer" mark (dark square, blue corner cut).
   ============================================================ */

:root {
  --ink: #191714;
  --ink-soft: #3a362f;
  --ink-mute: #6f6a60;
  --cream: #faf8f4;
  --cream-dim: #f1ede5;
  --line: #dcd6ca;
  --accent: #0047ff;          /* Electric Blue — from the brand kit logo */
  --accent-deep: #0038c7;

  /* Display and body share Inter; --serif kept as the "display" slot */
  --serif: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
           Helvetica, Arial, sans-serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
          Helvetica, Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --mark-ink: #111111;      /* logo colors, shared with the site accent */
  --mark-blue: var(--accent);

  --max: 68rem;
  --pad: clamp(1.25rem, 5vw, 3rem);
  --section-gap: clamp(5rem, 12vw, 9rem);
}

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

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

body {
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
}

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

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

a { color: inherit; }

/* ---------- Accessibility helpers ---------- */

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  z-index: 100;
  padding: .75rem 1.25rem;
  background: var(--ink);
  color: var(--cream);
  text-decoration: none;
}
.skip-link:focus { left: 1rem; top: 1rem; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

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

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

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

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  text-decoration: none;
}
.wordmark-name {
  font-weight: 800;
  font-size: .95rem;
  letter-spacing: -.02em;
}

/* Chamfer mark — dark square, blue corner cut, heavy "AS" */
.mark {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  overflow: hidden;
  background: var(--mark-ink);
  color: #fff;
  font-weight: 900;
  font-size: .75rem;
  letter-spacing: -.04em;
}
.mark::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  border-style: solid;
  border-width: 0 10px 10px 0;
  border-color: transparent var(--mark-blue) transparent transparent;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(.9rem, 3vw, 1.75rem);
  font-size: .9rem;
}
.site-nav a {
  text-decoration: none;
  color: var(--ink-soft);
  transition: color .2s ease;
}
.site-nav a:hover { color: var(--ink); }

.nav-cta {
  padding: .45rem .95rem;
  border: 1px solid var(--ink);
  border-radius: 999px;
  color: var(--ink) !important;
  transition: background .2s ease, color .2s ease;
}
.nav-cta:hover {
  background: var(--ink);
  color: var(--cream) !important;
}

/* ---------- Layout primitives ---------- */

main { display: block; }

section {
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--pad);
}

.section-head {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: clamp(2rem, 5vw, 3.5rem);
  border-top: 1px solid var(--line);
  padding-top: 1.25rem;
}

.section-num {
  font-family: var(--mono);
  font-size: .8rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: .15em;
}

.section-head h2 {
  font-family: var(--serif);
  font-weight: 800;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  letter-spacing: -.02em;
}

.kicker {
  font-family: var(--mono);
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--accent);
}
.kicker-light { color: #6f96ff; }

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

.hero {
  padding-top: clamp(5rem, 14vh, 9rem);
  padding-bottom: var(--section-gap);
  text-align: left;
}

.hero h1 {
  margin-top: 1.25rem;
  font-family: var(--serif);
  font-weight: 800;
  font-size: clamp(2.4rem, 6.5vw, 4.5rem);
  line-height: 1.06;
  letter-spacing: -.03em;
  max-width: 18em;
}
.hero h1 em {
  font-style: italic;
  color: var(--accent);
}

.hero-sub {
  margin-top: 1.5rem;
  max-width: 34em;
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  color: var(--ink-mute);
}

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

.hero-rule {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: clamp(3rem, 8vh, 5rem);
  color: var(--ink-mute);
}
.hero-rule::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}
.hero-rule-label {
  font-family: var(--mono);
  font-size: .68rem;
  font-weight: 500;
  letter-spacing: .22em;
  text-transform: uppercase;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .8rem 1.5rem;
  border-radius: 999px;
  font-size: .95rem;
  font-weight: 600;
  text-decoration: none;
  transition: transform .15s ease, background .2s ease,
              color .2s ease, border-color .2s ease;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--ink);
  color: var(--cream);
  border: 1px solid var(--ink);
}
.btn-primary:hover { background: var(--accent-deep); border-color: var(--accent-deep); }

.btn-ghost {
  border: 1px solid var(--line);
  color: var(--ink);
  background: transparent;
}
.btn-ghost:hover { border-color: var(--ink); }

.btn-invert {
  background: var(--cream);
  color: var(--ink);
  border: 1px solid var(--cream);
}
.btn-invert:hover { background: transparent; color: var(--cream); }

.btn-arrow { transition: transform .2s ease; }
.btn:hover .btn-arrow { transform: translateX(3px); }

/* ---------- Statement ---------- */

.statement { padding-bottom: var(--section-gap); }

.statement-text {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.4rem, 3.2vw, 2.1rem);
  line-height: 1.4;
  letter-spacing: -.015em;
  max-width: 26em;
  color: var(--ink-soft);
}
.statement-text .accent { color: var(--accent); }

/* ---------- Work ---------- */

.work { padding-bottom: var(--section-gap); }

.work-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: clamp(1.25rem, 3vw, 2rem);
}

.work-card {
  position: relative;
  overflow: hidden;
  background: var(--cream-dim);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: clamp(1.5rem, 3vw, 2rem);
  display: flex;
  flex-direction: column;
  gap: .9rem;
  transition: transform .25s ease, box-shadow .25s ease;
}
.work-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 32px -18px rgba(25, 23, 20, .35);
}

.work-index {
  font-family: var(--mono);
  font-size: .8rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: .15em;
}

.work-card h3 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.3rem;
  letter-spacing: -.015em;
}

.work-card p {
  color: var(--ink-mute);
  font-size: .97rem;
}

.work-list {
  margin-top: auto;
  list-style: none;
  border-top: 1px solid var(--line);
  padding-top: .9rem;
  display: grid;
  gap: .45rem;
  font-size: .9rem;
}
.work-list li {
  padding-left: 1.1rem;
  position: relative;
}
.work-list li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--accent);
}

/* ---------- Principles ---------- */

.principles { padding-bottom: var(--section-gap); }

.principles-list {
  list-style: none;
  counter-reset: principle;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 0;
  border-top: 1px solid var(--line);
}

.principles-list li {
  counter-increment: principle;
  padding: 1.6rem 1.5rem 1.6rem 0;
  border-bottom: 1px solid var(--line);
}

.principles-list h3 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -.01em;
  margin-bottom: .4rem;
}
.principles-list h3::before {
  content: counter(principle, decimal-leading-zero) "  ";
  font-family: var(--mono);
  font-weight: 600;
  font-size: .75rem;
  color: var(--accent);
  letter-spacing: .12em;
  margin-right: .5rem;
  position: relative;
  top: -.1em;
}

.principles-list p {
  color: var(--ink-mute);
  font-size: .95rem;
}

/* ---------- Journal ---------- */

.journal { padding-bottom: var(--section-gap); }

.journal-lede {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.25rem, 2.6vw, 1.7rem);
  line-height: 1.45;
  letter-spacing: -.01em;
  max-width: 30em;
  color: var(--ink-soft);
}

.journal-note {
  margin-top: 1.25rem;
  color: var(--ink-mute);
  max-width: 40em;
}

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

.about { padding-bottom: var(--section-gap); }

.about-body {
  max-width: 40em;
  display: grid;
  gap: 1.1rem;
  font-size: 1.08rem;
  color: var(--ink-soft);
}
.about-body em { color: var(--accent); }

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

.follow {
  max-width: none;
  padding-inline: 0;
  background: var(--ink);
  color: var(--cream);
}

.follow-inner {
  max-width: var(--max);
  margin-inline: auto;
  padding: var(--section-gap) var(--pad);
  text-align: center;
}

.follow-title {
  margin-top: 1rem;
  font-family: var(--serif);
  font-weight: 800;
  font-size: clamp(2rem, 5vw, 3.25rem);
  line-height: 1.08;
  letter-spacing: -.025em;
}

.follow-sub {
  margin: 1.25rem auto 2.25rem;
  max-width: 32em;
  color: #c9c3b8;
}

.follow-form { display: inline-block; }

.follow-links {
  margin-top: 2.5rem;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: .9rem;
  font-size: .92rem;
}
.follow-links a {
  color: #c9c3b8;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color .2s ease, border-color .2s ease;
}
.follow-links a:hover {
  color: var(--cream);
  border-color: var(--cream);
}
.follow-links .dot { color: #6f6a60; }

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

.site-footer {
  background: var(--ink);
  color: #a8a294;
  text-align: center;
  padding: 0 var(--pad) 3rem;
  font-size: .9rem;
}
.site-footer::before {
  content: "";
  display: block;
  width: min(var(--max), 100%);
  margin: 0 auto 2.5rem;
  border-top: 1px solid #35322c;
}

.footer-name {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -.01em;
  color: var(--cream);
  margin-bottom: .35rem;
}

.footer-meta a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid #55514a;
}
.footer-meta a:hover { color: var(--cream); }

.footer-line {
  margin-top: 1.25rem;
  font-family: var(--serif);
  font-style: italic;
  color: #7d786d;
}

/* ---------- Reveal animation ---------- */

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .7s ease, transform .7s ease;
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* Stagger siblings slightly */
.reveal.is-visible:nth-child(2) { transition-delay: .08s; }
.reveal.is-visible:nth-child(3) { transition-delay: .16s; }
.reveal.is-visible:nth-child(4) { transition-delay: .24s; }

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

/* ============================================================
   Motion & depth — "bank meets tech"
   Ledger grids, drawn rules, card tilt + sheen. All effects
   respect prefers-reduced-motion; tilt is pointer-fine only.
   ============================================================ */

/* --- Hero: faint ledger/blueprint grid + blue glow --- */

.hero { position: relative; }

.hero::before,
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

.hero::before {
  background-image:
    linear-gradient(rgba(25, 23, 20, .05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(25, 23, 20, .05) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(120% 90% at 28% 12%, #000 30%, transparent 75%);
  mask-image: radial-gradient(120% 90% at 28% 12%, #000 30%, transparent 75%);
}

.hero::after {
  background: radial-gradient(560px circle at 78% 16%,
              rgba(0, 71, 255, .07), transparent 65%);
}

@media (prefers-reduced-motion: no-preference) {
  .hero::before {
    animation: grid-drift 26s linear infinite;
  }
  @keyframes grid-drift {
    to { background-position: 44px 44px; }
  }
}

/* --- Hero headline: focus-in --- */

.hero h1.reveal {
  filter: blur(10px);
  transition: opacity .7s ease, transform .7s ease, filter .7s ease;
}
.hero h1.reveal.is-visible { filter: blur(0); }

/* --- Section rules draw themselves in --- */

.section-head {
  border-top-color: transparent;
  position: relative;
}
.section-head::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  width: 100%;
  height: 1px;
  background: var(--line);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 1.1s cubic-bezier(.22, 1, .36, 1) .1s;
}
.section-head.is-visible::before { transform: scaleX(1); }

/* --- Statement: marker highlight sweeps across the accent --- */

.statement-text .accent {
  background-image: linear-gradient(rgba(0, 71, 255, .08), rgba(0, 71, 255, .08));
  background-repeat: no-repeat;
  background-position: 0 0;
  background-size: 0% 100%;
  transition: background-size 1.1s cubic-bezier(.22, 1, .36, 1) .45s;
}
.statement-text.is-visible .accent { background-size: 100% 100%; }

/* --- Work cards: 3D tilt + light sheen (card-in-hand feel) --- */

.work-grid { perspective: 1100px; }

.work-card {
  --rx: 0deg;
  --ry: 0deg;
  transform-style: preserve-3d;
}
.work-card.reveal.is-visible {
  transform: rotateX(var(--rx)) rotateY(var(--ry));
  transition: opacity .7s ease, transform .18s ease-out, box-shadow .25s ease;
  transition-delay: 0s;
}
.work-card.reveal.is-visible:hover {
  transform: rotateX(var(--rx)) rotateY(var(--ry)) translateY(-4px);
}

.work-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(340px circle at var(--gx, 50%) var(--gy, 30%),
              rgba(0, 71, 255, .09),
              rgba(255, 255, 255, .07) 42%,
              transparent 68%);
  opacity: 0;
  transition: opacity .3s ease;
  pointer-events: none;
}
.work-card:hover::after { opacity: 1; }

/* --- Logo mark: sheen pass on hover --- */

.mark::before {
  content: "";
  position: absolute;
  inset: -40%;
  background: linear-gradient(115deg, transparent 42%,
              rgba(255, 255, 255, .38) 50%, transparent 58%);
  transform: translateX(-90%);
  pointer-events: none;
}
.wordmark:hover .mark::before {
  transform: translateX(90%);
  transition: transform .65s ease;
}

/* --- Buttons: lift with blue-cast shadow --- */

.btn-primary:hover,
.btn-invert:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 26px -12px rgba(0, 71, 255, .55);
}

/* --- Nav links: underline sweep --- */

.site-nav a:not(.nav-cta) {
  background-image: linear-gradient(var(--accent), var(--accent));
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0% 1px;
  transition: color .2s ease, background-size .3s ease;
  padding-bottom: 2px;
}
.site-nav a:not(.nav-cta):hover { background-size: 100% 1px; }

/* --- Follow section: fine grid + breathing glow on the dark field --- */

.follow {
  position: relative;
  overflow: hidden;
}
.follow::before,
.follow::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.follow::before {
  background-image:
    linear-gradient(rgba(250, 248, 244, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(250, 248, 244, .045) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(90% 120% at 50% 40%, #000 30%, transparent 80%);
  mask-image: radial-gradient(90% 120% at 50% 40%, #000 30%, transparent 80%);
}
.follow::after {
  background: radial-gradient(640px circle at 50% 30%,
              rgba(0, 71, 255, .13), transparent 65%);
  opacity: .6;
}
.follow-inner { position: relative; z-index: 1; }

@media (prefers-reduced-motion: no-preference) {
  .follow::after { animation: glow-breathe 7s ease-in-out infinite alternate; }
  @keyframes glow-breathe {
    from { opacity: .35; }
    to   { opacity: .85; }
  }
}

/* --- Reduced motion: settle everything instantly --- */

@media (prefers-reduced-motion: reduce) {
  .hero h1.reveal { filter: none; transition: none; }
  .section-head::before { transform: scaleX(1); transition: none; }
  .statement-text .accent { background-size: 100% 100%; transition: none; }
  .work-card.reveal.is-visible { transition: box-shadow .25s ease; }
  .mark::before,
  .wordmark:hover .mark::before { transform: none; transition: none; }
}

/* ---------- Responsive tweaks ---------- */

.br-desktop { display: none; }

@media (min-width: 46rem) {
  .br-desktop { display: inline; }
}

@media (max-width: 40rem) {
  .site-nav a:not(.nav-cta) { display: none; }
  .hero-actions .btn { width: 100%; justify-content: center; }
  .wordmark-name { display: none; }
}
