/* =========================================================================
   Joe Foley — Portfolio v1
   Design tokens, base styles, layout, components, sections.
   No build step. Pure CSS with custom properties.
   ========================================================================= */

:root {
  /* Palette */
  --bg:           #FAFAF7;
  --bg-alt:       #F4F2EC;
  --surface:      #FFFFFF;
  --ink:          #0F0F0F;
  --ink-soft:     #2A2A2A;
  --muted:        #5C5C5C;
  --muted-soft:   #8A8A85;
  --border:       #EAE7E0;
  --border-soft:  #F1EFE9;
  --accent:       #0F0F0F;
  --accent-hover: #2A2A2A;

  /* Type */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;

  --fs-xs:  0.8125rem;   /* 13 */
  --fs-sm:  0.9375rem;   /* 15 */
  --fs-md:  1.0625rem;   /* 17 */
  --fs-lg:  1.25rem;     /* 20 */
  --fs-xl:  1.625rem;    /* 26 */
  --fs-2xl: 2.125rem;    /* 34 */
  --fs-3xl: 3rem;        /* 48 */
  --fs-4xl: clamp(2.5rem, 5.5vw, 4.25rem);

  /* Layout */
  --container: 1200px;
  --gutter: 1.5rem;
  --section-y: clamp(4.5rem, 8vw, 7.5rem);

  /* Motion */
  --ease: cubic-bezier(.22, .61, .36, 1);
  --dur:  240ms;

  /* Radii & shadow */
  --radius-sm: 6px;
  --radius:    10px;
  --radius-lg: 16px;
  --shadow-1: 0 1px 2px rgba(15,15,15,.04), 0 4px 16px rgba(15,15,15,.04);
}

/* =========================================================================
   Reset & base
   ========================================================================= */

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--fs-md);
  line-height: 1.6;
  font-feature-settings: 'cv11', 'ss01', 'ss03';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

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

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

p { margin: 0 0 1rem; }

h1, h2, h3, h4 { margin: 0 0 1rem; font-weight: 600; letter-spacing: -0.015em; line-height: 1.15; color: var(--ink); }

h1 { font-size: var(--fs-4xl); letter-spacing: -0.025em; line-height: 1.05; }
h2 { font-size: var(--fs-3xl); letter-spacing: -0.02em; line-height: 1.1; }
h3 { font-size: var(--fs-xl); }
h4 { font-size: var(--fs-lg); }

ul { padding: 0; margin: 0; list-style: none; }

::selection { background: var(--ink); color: var(--bg); }

.skip-link {
  position: absolute; top: -40px; left: 1rem;
  padding: .5rem .75rem; background: var(--ink); color: var(--bg);
  border-radius: var(--radius-sm); z-index: 100;
}
.skip-link:focus { top: 1rem; }

/* =========================================================================
   Layout
   ========================================================================= */

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.section { padding: var(--section-y) 0; border-top: 1px solid var(--border); }

.section-head { margin-bottom: 3rem; max-width: 760px; }
.section-label {
  display: inline-block;
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--muted);
  font-weight: 500;
  margin: 0 0 1rem;
}
.section-title { margin-bottom: .75rem; }
.section-sub { color: var(--muted); font-size: var(--fs-md); max-width: 56ch; }

.two-col {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.5rem;
}
@media (min-width: 880px) {
  .two-col { grid-template-columns: 220px minmax(0, 1fr); gap: 4rem; }
}
.col-label { padding-top: .25rem; }
.col-body p { color: var(--muted); max-width: 62ch; font-size: var(--fs-md); }
.col-body p:last-child { margin-bottom: 0; }

/* =========================================================================
   Header / nav
   ========================================================================= */

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(250, 250, 247, 0.85);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.site-header[data-scrolled="true"] { border-bottom-color: var(--border); }

.nav-container {
  display: flex; align-items: center; justify-content: space-between;
  height: 72px;
}

.brand {
  display: flex; align-items: center; gap: .65rem;
  font-weight: 600; font-size: var(--fs-md); letter-spacing: -0.01em;
}
.brand-mark {
  width: 28px; height: 28px; border-radius: 6px;
  background: var(--ink); color: var(--bg);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600; letter-spacing: 0;
}

.primary-nav { display: none; gap: 2rem; }
.primary-nav a {
  font-size: var(--fs-sm); color: var(--ink-soft);
  font-weight: 500;
  position: relative;
  transition: color var(--dur) var(--ease);
}
.primary-nav a::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -6px;
  height: 1px; background: var(--ink); transform: scaleX(0);
  transform-origin: left; transition: transform var(--dur) var(--ease);
}
.primary-nav a:hover { color: var(--ink); }
.primary-nav a:hover::after { transform: scaleX(1); }

.nav-cta { display: none; }

@media (min-width: 880px) {
  .primary-nav { display: flex; }
  .nav-cta { display: inline-flex; }
  .mobile-toggle { display: none; }
}

/* Mobile toggle */
.mobile-toggle {
  display: inline-flex; flex-direction: column; justify-content: center; gap: 5px;
  width: 36px; height: 36px; padding: 0;
  background: transparent; border: 1px solid var(--border);
  border-radius: var(--radius-sm); cursor: pointer;
}
.mobile-toggle span {
  display: block; width: 16px; height: 1.5px; background: var(--ink);
  margin: 0 auto;
  transition: transform var(--dur) var(--ease), opacity var(--dur) var(--ease);
}
.mobile-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.mobile-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.mobile-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

.mobile-nav {
  display: flex; flex-direction: column;
  border-top: 1px solid var(--border);
  padding: 1rem var(--gutter) 1.5rem;
  background: var(--bg);
}
.mobile-nav a {
  padding: .85rem 0;
  border-bottom: 1px solid var(--border-soft);
  font-size: var(--fs-md); font-weight: 500;
}
.mobile-nav a:last-child { border-bottom: 0; }

/* =========================================================================
   Buttons & links
   ========================================================================= */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: .5rem;
  padding: 0.85rem 1.4rem;
  font-size: var(--fs-sm);
  font-weight: 500; letter-spacing: -0.005em;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease),
              border-color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.btn-sm { padding: 0.55rem 1rem; font-size: var(--fs-xs); }

.btn-primary {
  background: var(--accent); color: var(--bg); border-color: var(--accent);
}
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

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

.link-arrow {
  display: inline-block;
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--ink);
  border-bottom: 1px solid var(--border);
  padding-bottom: 2px;
  transition: border-color var(--dur) var(--ease);
}
.link-arrow:hover { border-color: var(--ink); }

/* =========================================================================
   Hero
   ========================================================================= */

.hero {
  padding: clamp(5rem, 11vw, 9rem) 0 clamp(4rem, 8vw, 6rem);
}
.eyebrow {
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--muted);
  font-weight: 500;
  margin-bottom: 2rem;
}
.hero-title {
  margin-bottom: 1.5rem;
  max-width: 18ch;
}
.hero-lede {
  font-size: var(--fs-lg);
  color: var(--muted);
  max-width: 62ch;
  margin-bottom: 2.25rem;
}
.hero-actions { display: flex; gap: .75rem; flex-wrap: wrap; }

/* =========================================================================
   About
   ========================================================================= */

.credentials {
  display: grid; grid-template-columns: 1fr; gap: 1.25rem;
  margin-top: 2.5rem; padding-top: 2rem; border-top: 1px solid var(--border);
}
@media (min-width: 640px) { .credentials { grid-template-columns: repeat(3, 1fr); gap: 2rem; } }
.credentials li span {
  display: block;
  font-size: var(--fs-lg); font-weight: 600; color: var(--ink);
  letter-spacing: -0.01em;
  margin-bottom: .25rem;
}
.credentials li p { margin: 0; font-size: var(--fs-sm); color: var(--muted); }

/* =========================================================================
   Services
   ========================================================================= */

.services-grid {
  display: grid; grid-template-columns: 1fr; gap: 1rem;
}
@media (min-width: 720px) { .services-grid { grid-template-columns: repeat(3, 1fr); gap: 1.25rem; } }

.service-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem 1.75rem;
  display: flex; flex-direction: column;
  transition: border-color var(--dur) var(--ease), transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.service-card:hover {
  border-color: var(--ink-soft);
  transform: translateY(-2px);
  box-shadow: var(--shadow-1);
}
.service-num {
  font-size: var(--fs-xs);
  font-weight: 500; letter-spacing: 0.18em;
  color: var(--muted-soft);
  margin: 0 0 1.5rem;
}
.service-card h3 { margin-bottom: .75rem; }
.service-card p { color: var(--muted); font-size: var(--fs-sm); flex-grow: 1; }
.service-card .link-arrow { margin-top: 1rem; align-self: flex-start; }

/* Commerce strip — future shop placeholders */
.commerce-strip {
  margin-top: 3.5rem;
  display: grid; grid-template-columns: 1fr; gap: 1rem;
  padding: 1.75rem;
  background: var(--bg-alt);
  border-radius: var(--radius-lg);
  border: 1px dashed var(--border);
}
@media (min-width: 720px) { .commerce-strip { grid-template-columns: repeat(3, 1fr); gap: 1.5rem; } }

.commerce-card { padding: .25rem; }
.commerce-card h4 { margin: .5rem 0 .25rem; font-size: var(--fs-md); }
.commerce-card p { margin: 0; font-size: var(--fs-sm); color: var(--muted); }
.badge {
  display: inline-block;
  font-size: 11px; letter-spacing: 0.15em; text-transform: uppercase; font-weight: 600;
  color: var(--muted); background: var(--surface);
  padding: .2rem .55rem; border-radius: 999px; border: 1px solid var(--border);
  margin: 0 0 .5rem;
}

/* =========================================================================
   Work / project gallery
   ========================================================================= */

.work-grid {
  display: grid; gap: 1rem;
  grid-template-columns: repeat(2, 1fr);
}
@media (min-width: 720px) { .work-grid { grid-template-columns: repeat(3, 1fr); gap: 1.25rem; } }
@media (min-width: 1080px) { .work-grid { grid-template-columns: repeat(4, 1fr); gap: 1.5rem; } }

.work-tile {
  display: block;
  transition: transform var(--dur) var(--ease);
}
.work-tile:hover { transform: translateY(-3px); }
.work-tile:hover .tile-figure { box-shadow: var(--shadow-1); }
.work-tile:hover .tile-figure::after { opacity: 1; }

.tile-figure {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius);
  overflow: hidden;
  margin: 0 0 .85rem;
  background: linear-gradient(135deg, #ECE9E1 0%, #F4F2EC 100%);
  border: 1px solid var(--border);
  transition: box-shadow var(--dur) var(--ease);
}
.tile-figure figcaption {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: var(--fs-md); font-weight: 500; color: var(--muted);
  letter-spacing: -0.01em;
}
.tile-figure::before {
  content: attr(data-tile);
  position: absolute; top: 14px; left: 16px;
  font-size: 11px; font-weight: 500; letter-spacing: 0.18em;
  color: var(--muted-soft);
}
.tile-figure::after {
  content: '↗';
  position: absolute; top: 12px; right: 14px;
  font-size: 16px; color: var(--ink);
  opacity: 0; transition: opacity var(--dur) var(--ease);
}

/* Subtle gradient variation per tile so the gallery feels designed, not blank */
.work-tile:nth-child(2)  .tile-figure { background: linear-gradient(135deg, #E8E4DA 0%, #F0EDE5 100%); }
.work-tile:nth-child(3)  .tile-figure { background: linear-gradient(135deg, #F0EDE5 0%, #E4E0D6 100%); }
.work-tile:nth-child(4)  .tile-figure { background: linear-gradient(135deg, #ECE9E1 0%, #DFD9CC 100%); }
.work-tile:nth-child(5)  .tile-figure { background: linear-gradient(135deg, #F2EFE8 0%, #E8E4DA 100%); }
.work-tile:nth-child(6)  .tile-figure { background: linear-gradient(135deg, #E4E0D6 0%, #EFEBE2 100%); }
.work-tile:nth-child(7)  .tile-figure { background: linear-gradient(135deg, #EFEBE2 0%, #E0DCD0 100%); }
.work-tile:nth-child(8)  .tile-figure { background: linear-gradient(135deg, #E0DCD0 0%, #ECE9E1 100%); }

.tile-meta {
  display: flex; justify-content: space-between;
  font-size: var(--fs-xs);
  color: var(--muted);
  margin: 0;
}
.tile-meta span:first-child { color: var(--ink); font-weight: 500; }

/* =========================================================================
   Testimonials
   ========================================================================= */

.quotes-grid {
  display: grid; grid-template-columns: 1fr; gap: 1.5rem;
}
@media (min-width: 880px) { .quotes-grid { grid-template-columns: repeat(3, 1fr); gap: 2rem; } }

.quote { margin: 0; }
.quote blockquote {
  margin: 0 0 1rem;
  font-size: var(--fs-lg);
  line-height: 1.4;
  letter-spacing: -0.005em;
  color: var(--ink);
}
.quote figcaption {
  font-size: var(--fs-sm);
  color: var(--muted);
}

/* =========================================================================
   Contact
   ========================================================================= */

.contact-actions {
  display: flex; gap: .75rem; margin-top: 1.5rem; flex-wrap: wrap;
}
.contact-meta {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: var(--fs-sm);
  color: var(--muted);
}

/* =========================================================================
   Footer
   ========================================================================= */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 3rem 0 2rem;
}
.footer-grid {
  display: grid; grid-template-columns: 1fr; gap: 1.5rem;
  align-items: start;
}
@media (min-width: 720px) {
  .footer-grid {
    grid-template-columns: 1fr auto auto;
    gap: 3rem; align-items: center;
  }
}
.footer-brand { font-weight: 600; margin: 0 0 .25rem; }
.footer-tag { color: var(--muted); font-size: var(--fs-sm); margin: 0; }
.footer-nav { display: flex; gap: 1.5rem; }
.footer-nav a {
  font-size: var(--fs-sm); color: var(--muted);
  transition: color var(--dur) var(--ease);
}
.footer-nav a:hover { color: var(--ink); }
.footer-legal { font-size: var(--fs-xs); color: var(--muted-soft); margin: 0; }

/* =========================================================================
   Reveal animations (subtle)
   ========================================================================= */

[data-reveal] {
  opacity: 0; transform: translateY(12px);
  transition: opacity 600ms var(--ease), transform 600ms var(--ease);
}
[data-reveal].is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
  [data-reveal] { opacity: 1; transform: none; }
}
