/* Smarketing! — shared styles */

:root {
  --paper: #F8F6F1;
  --paper-deep: #EFEBE3;
  --ink: #1B3A6B;
  --ink-deep: #132B52;
  --navy: #1B3A6B;
  --muted: rgba(27, 58, 107, 0.74);
  --hair: rgba(27, 58, 107, 0.16);
  --serif: "Newsreader", "Iowan Old Style", "Times New Roman", serif;
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --gutter: clamp(20px, 5vw, 64px);
  --max: 1200px;
}

@view-transition { navigation: auto; }

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

html { -webkit-text-size-adjust: 100%; background: var(--paper); }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

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

a { color: inherit; -webkit-tap-highlight-color: transparent; }

:focus-visible { outline: 1px solid var(--navy); outline-offset: 6px; border-radius: 2px; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------- Header: Work · logo · Contact ---------- */

.site-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(24px, 5vh, 44px) var(--gutter) 0;
  view-transition-name: site-header;
}

.site-header .logo { grid-column: 2; line-height: 0; display: block; }

.site-header .logo img {
  display: block;
  width: clamp(138px, 17vw, 210px);
  height: auto;
}

.nav-link {
  justify-self: start;
  position: relative;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink);
  padding: 12px 0;
}

.nav-link.right { justify-self: end; }

.nav-link::after,
.text-link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 6px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.6s var(--ease);
}

.nav-link:hover::after,
.nav-link[aria-current="page"]::after,
.text-link:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

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

.site-footer {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 28px var(--gutter) max(28px, env(safe-area-inset-bottom));
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px 24px;
  flex-wrap: wrap;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--ink); }
.site-footer .links { display: flex; gap: 24px; flex-wrap: wrap; }

/* ---------- Shared type ---------- */

.display {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-optical-sizing: auto;
  letter-spacing: -0.028em;
  line-height: 0.98;
  color: var(--ink);
}

.accent { color: var(--navy); }

.eyebrow {
  margin: 0;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- Button ---------- */

.button {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 18px 32px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-size: 16px;
  font-weight: 400;
  letter-spacing: 0.005em;
  white-space: nowrap;
  text-decoration: none;
  transition: background-color 0.5s var(--ease), transform 0.5s var(--ease);
}

.button .arrow { display: inline-block; transition: transform 0.5s var(--ease); }
.button:hover { background: var(--ink-deep); }
.button:hover .arrow { transform: translateX(4px); }
.button:active { transform: scale(0.98); }

/* ---------- Home ---------- */

.home {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6vh var(--gutter);
}

.home .display {
  font-size: clamp(50px, 8.8vw, 136px);
  max-width: 7.6em;
  text-wrap: balance;
}

.home .display .w {
  display: inline-block;
  opacity: 0;
  filter: blur(14px);
  transform: translateY(0.12em);
  animation: focusIn 1.6s var(--ease) forwards;
  animation-delay: calc(0.35s + var(--i) * 0.11s);
}

.js-fonts-pending .home .display .w,
.js-fonts-pending .home .display .stop,
.js-fonts-pending .home .cta { animation-play-state: paused; }

/* The full stop borrows the logo's blue */
.home .display .stop {
  display: inline-block;
  color: var(--navy);
  opacity: 0;
  transform: scale(0.2);
  animation: pop 0.9s var(--ease) forwards;
  animation-delay: calc(0.6s + var(--i) * 0.11s);
}

.home .cta {
  margin-top: clamp(40px, 7vh, 72px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  opacity: 0;
  animation: rise 1.2s var(--ease) 1.7s forwards;
}

.phone {
  font-size: clamp(18px, 1.8vw, 22px);
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
  text-decoration: none;
  color: var(--ink);
}

.phone:hover { color: var(--navy); }

@keyframes focusIn {
  to { opacity: 1; filter: blur(0); transform: none; }
}

@keyframes pop {
  60% { opacity: 1; transform: scale(1.25); }
  to  { opacity: 1; transform: scale(1); }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- Inner pages ---------- */

.page {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(56px, 12vh, 140px) var(--gutter) clamp(56px, 10vh, 120px);
}

.page-head { margin-bottom: clamp(48px, 9vh, 96px); }
.page-head .eyebrow { margin-bottom: 22px; }
.page-head .display { font-size: clamp(46px, 7vw, 104px); }

.page-head .lede {
  margin: 28px 0 0;
  max-width: 34em;
  font-family: var(--serif);
  font-size: clamp(20px, 2vw, 24px);
  line-height: 1.45;
  color: var(--muted);
  text-wrap: pretty;
}

.reveal {
  opacity: 0;
  animation: rise 1.2s var(--ease) forwards;
  animation-delay: var(--d, 0.1s);
}

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

.work-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(48px, 7vw, 96px) clamp(24px, 4vw, 56px);
}

.project { margin: 0; }
.project:nth-child(even) { margin-top: clamp(0px, 10vw, 140px); }

.project a { display: block; text-decoration: none; }

.project .frame {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: 2px;
  background: var(--paper-deep);
}

.project .frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 1.4s var(--ease);
}

.project a:hover .frame img { transform: scale(1.035); }

.project .soon {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-style: italic;
  font-size: 20px;
  color: var(--muted);
}

.project figcaption {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding-top: 18px;
  border-top: 0;
}

.project h2 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(22px, 2.2vw, 28px);
  letter-spacing: -0.01em;
}

.project .tag {
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.work-end {
  margin-top: clamp(80px, 14vh, 160px);
  text-align: center;
}

.work-end .display { font-size: clamp(34px, 4.6vw, 64px); margin-bottom: 36px; }

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

.contact-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--hair);
}

.contact-list li { border-bottom: 1px solid var(--hair); }

.contact-row {
  display: grid;
  grid-template-columns: minmax(90px, 200px) 1fr auto;
  align-items: center;
  gap: 24px;
  padding: clamp(22px, 3.6vh, 34px) 0;
  text-decoration: none;
  color: var(--ink);
}

.contact-row .label {
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted);
}

.contact-row .value {
  font-family: var(--serif);
  font-size: clamp(26px, 3.6vw, 48px);
  letter-spacing: -0.02em;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.contact-row .go {
  font-size: 22px;
  color: var(--navy);
  opacity: 0;
  transform: translateX(-10px);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
}

a.contact-row .value { transition: transform 0.6s var(--ease); }
a.contact-row:hover .value { transform: translateX(8px); }
a.contact-row:hover .go { opacity: 1; transform: none; }

/* ---------- Small screens ---------- */

@media (max-width: 640px) {
  .nav-link { font-size: 11px; letter-spacing: 0.16em; }
  .home .display { font-size: clamp(44px, 13.4vw, 72px); }
  .work-grid { grid-template-columns: 1fr; }
  .project .frame { aspect-ratio: 4 / 3; }
  .project:nth-child(even) { margin-top: 0; }
  .contact-row { grid-template-columns: 1fr; gap: 6px; }
  .contact-row .go { display: none; }
  .site-footer { flex-direction: column; text-align: center; }
  .site-footer .links { justify-content: center; }
}

@media (max-width: 380px) {
  .button { font-size: 14px; padding: 16px 22px; gap: 10px; }
}

/* Tablets held upright: use the extra height */
@media (min-width: 641px) and (max-width: 1100px) and (orientation: portrait) {
  .home .display { font-size: 12.4vw; }
  .home .cta { margin-top: 64px; }
  .button { font-size: 18px; padding: 20px 36px; }
  .page-head .display { font-size: 10vw; }
  .page-head .lede { font-size: 3vw; }
  .contact-row .value { font-size: 5.2vw; }
}

/* Phones held sideways: keep the homepage on one calm screen */
@media (max-height: 500px) and (orientation: landscape) {
  .site-header { padding-top: 16px; }
  .site-header .logo img { width: 132px; }
  .home { padding: 12px var(--gutter); }
  .home .display { font-size: min(8.8vw, 13vh); }
  .home .cta { margin-top: 24px; }
  .site-footer { padding-top: 12px; padding-bottom: 14px; }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    transition-duration: 0.01ms !important;
  }
  @view-transition { navigation: none; }
}
