/* Richard A. Abbey — portfolio
   Layout concept: a newsroom front page. Masthead, a lead story pair,
   then a tight grid of datelined work; one cobalt accent, hairline rules. */

:root {
  --paper: #F6F6F3;
  --ink: #121417;
  --ink-2: #4A4F57;
  --rule: #DADBD6;
  --card: #FFFFFF;
  --accent: #2340E6;
  --accent-soft: #E6E9FD;

  --serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  --sans: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;

  --t-xs: .75rem; --t-sm: .875rem; --t-md: 1.0625rem;
  --t-lg: clamp(1.25rem, 1.1rem + .5vw, 1.5rem);
  --t-xl: clamp(1.6rem, 1.2rem + 1.4vw, 2.4rem);
  --t-hero: clamp(2.6rem, 1.4rem + 4.6vw, 5.4rem);

  --gutter: clamp(20px, 5vw, 56px);
  --max: 1240px;
  --ease: cubic-bezier(.2,.7,.1,1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #101215; --ink: #ECEDEA; --ink-2: #A3A8B0; --rule: #2A2E34;
    --card: #171A1E; --accent: #8EA0FF; --accent-soft: #1D2347; color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--sans); font-size: var(--t-md); line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.12; letter-spacing: -0.01em; margin: 0; text-wrap: balance; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
::selection { background: var(--accent); color: var(--paper); }

.wrap {
  max-width: calc(var(--max) + 2 * var(--gutter)); margin-inline: auto;
  padding-left: max(var(--gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
}
.kicker { font-family: var(--mono); font-size: var(--t-xs); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }
.kicker b { color: var(--accent); font-weight: 500; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; z-index: 99; background: var(--ink); color: var(--paper); padding: .6rem 1rem; }

/* Masthead */
.mast {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  background: color-mix(in srgb, var(--paper) 90%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
}
.mast-in { display: flex; align-items: center; justify-content: space-between; gap: 1rem; height: 64px; }
.name { font-family: var(--serif); font-size: 1.3rem; font-weight: 600; text-decoration: none; letter-spacing: -0.01em; }
.nav { display: flex; gap: clamp(.9rem, 2.5vw, 2rem); font-size: var(--t-sm); }
.nav a { text-decoration: none; color: var(--ink-2); transition: color .2s; }
.nav a:hover { color: var(--ink); }
.nav .cta { color: var(--accent); font-weight: 500; }

/* Hero */
.hero { padding-block: clamp(3.5rem, 2rem + 6vw, 7rem) clamp(2.5rem, 2rem + 3vw, 4.5rem); }
.hero h1 { font-size: var(--t-hero); max-width: 17ch; margin-top: 1.25rem; font-weight: 400; }
.hero h1 em { font-style: italic; color: var(--accent); }
.hero .lede { margin-top: 1.5rem; max-width: 52ch; font-size: var(--t-lg); line-height: 1.5; color: var(--ink-2); }
.hero-actions { margin-top: 2rem; display: flex; flex-wrap: wrap; gap: .75rem; }
.btn {
  display: inline-flex; align-items: center; gap: .5rem; padding: .8rem 1.25rem;
  font-size: var(--t-sm); font-weight: 500; text-decoration: none; border-radius: 999px;
  border: 1px solid var(--ink); transition: background-color .2s, color .2s, transform .2s var(--ease);
}
.btn:hover { transform: translateY(-1px); }
.btn-solid { background: var(--ink); color: var(--paper); }
.btn-solid:hover { background: var(--accent); border-color: var(--accent); }
.btn-ghost:hover { background: var(--ink); color: var(--paper); }

/* Credentials: a dateline strip */
.creds { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); border-block: 1px solid var(--rule); }
.cred { padding: 1.25rem 1.25rem 1.25rem 0; display: grid; gap: .3rem; text-decoration: none; color: inherit; }
.cred + .cred { border-left: 1px solid var(--rule); padding-left: 1.25rem; }
.cred strong { font-family: var(--serif); font-weight: 500; font-size: 1.15rem; line-height: 1.25; }
.thumb img.left { object-position: left top; }
a.cred:hover strong { color: var(--accent); }

/* Section heads */
.section { padding-block: clamp(3.5rem, 2rem + 5vw, 6rem); }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 1.5rem; flex-wrap: wrap; margin-bottom: 2rem; }
.section-head h2 { font-size: var(--t-xl); }

.filters { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip {
  font: inherit; font-size: var(--t-sm); padding: .4rem .9rem; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--rule); background: transparent; color: var(--ink-2); transition: all .2s;
}
.chip:hover { border-color: var(--ink); color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* Work */
.lead { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: clamp(1.25rem, 3vw, 2.5rem); margin-bottom: clamp(2rem, 4vw, 3rem); }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: clamp(1.25rem, 3vw, 2.5rem) clamp(1.25rem, 2.5vw, 2rem); }
.story { display: grid; gap: .8rem; align-content: start; text-decoration: none; min-width: 0; }
.story[hidden] { display: none; }
.thumb {
  aspect-ratio: 16 / 10; overflow: hidden; border-radius: 6px; background: var(--card);
  border: 1px solid var(--rule); max-width: 100%;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top center; transition: transform .8s var(--ease); }
.story:hover .thumb img { transform: scale(1.03); }
.story h3 { font-size: var(--t-lg); transition: color .2s; }
.lead .story h3 { font-size: var(--t-xl); }
.story:hover h3 { color: var(--accent); }
.story p { color: var(--ink-2); font-size: var(--t-sm); max-width: 60ch; }
.story .go { font-size: var(--t-sm); font-weight: 500; color: var(--accent); }

/* Methods */
.methods { background: var(--card); border-block: 1px solid var(--rule); }
.method-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 1.5rem; }
.method { display: grid; gap: .5rem; align-content: start; padding-top: 1rem; border-top: 2px solid var(--ink); }
.method h3 { font-size: 1.2rem; }
.method p { color: var(--ink-2); font-size: var(--t-sm); }

/* About */
.about { display: grid; grid-template-columns: minmax(0,5fr) minmax(0,7fr); gap: clamp(2rem, 5vw, 5rem); }
.about h2 { font-size: var(--t-xl); }
.about-body { display: grid; gap: 1.1rem; font-size: 1.125rem; max-width: 62ch; }
.about-body .first::first-letter { font-family: var(--serif); float: left; font-size: 3.6rem; line-height: .9; padding: .25rem .5rem 0 0; color: var(--accent); }

/* Contact */
.contact { border-top: 1px solid var(--rule); }
.contact h2 { font-size: var(--t-hero); font-weight: 400; max-width: 14ch; }
.contact h2 em { color: var(--accent); }
.contact-row { margin-top: 2rem; display: flex; flex-wrap: wrap; gap: 1rem 2rem; align-items: center; }
.email { font-family: var(--serif); font-size: var(--t-xl); text-decoration: none; border-bottom: 1px solid var(--accent); }
.email:hover { color: var(--accent); }
.social { display: flex; gap: 1.25rem; font-size: var(--t-sm); }
.social a { color: var(--ink-2); text-decoration: none; }
.social a:hover { color: var(--accent); }

.foot { border-top: 1px solid var(--rule); padding-block: 1.5rem calc(1.5rem + env(safe-area-inset-bottom, 0px)); }
.foot-in { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem; }

/* Motion */
.hero > * { animation: up .9s var(--ease) both; }
.hero > *:nth-child(2) { animation-delay: .08s; } .hero > *:nth-child(3) { animation-delay: .16s; } .hero > *:nth-child(4) { animation-delay: .24s; }
@keyframes up { from { opacity: .001; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } html { scroll-behavior: auto; } }

/* Responsive */
@media (max-width: 960px) {
  .grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .creds, .method-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .cred:nth-child(3) { border-left: 0; padding-left: 0; }
  .cred:nth-child(n+3) { border-top: 1px solid var(--rule); }
  .about { grid-template-columns: minmax(0,1fr); }
}
@media (max-width: 640px) {
  .nav a:not(.cta):not(.keep) { display: none; }
  .lead, .grid, .method-grid { grid-template-columns: minmax(0,1fr); }
  .creds { grid-template-columns: minmax(0,1fr); }
  .cred + .cred { border-left: 0; padding-left: 0; border-top: 1px solid var(--rule); }
  .cred { padding-right: 0; }
}
