/* =============================================
   MAIN.CSS — Global Styles
   iansullivanart.com
   ============================================= */

/* =============================================
   Custom Properties — Light (default)
   ============================================= */
:root {
  /* Palette */
  --color-bg:       #ffffff;
  --color-fg:       #111111;
  --color-fg-muted: #555555;
  --color-border:   #e0e0e0;
  --color-surface:  #f5f5f5;

  /* Pattern */
  --pattern-url:     url('../assets/pattern/pattern-light.svg');
  --pattern-opacity: 0.045;

  /* Typography */
  --font-body: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-weight-light:    300;
  --font-weight-regular:  400;
  --font-weight-medium:   500;
  --font-weight-semibold: 600;
  --font-weight-bold:     700;

  --text-xs:   0.75rem;
  --text-sm:   0.875rem;
  --text-base: 1rem;
  --text-lg:   1.125rem;
  --text-xl:   1.25rem;
  --text-2xl:  1.5rem;
  --text-3xl:  1.875rem;
  --text-4xl:  2.25rem;
  --text-5xl:  3rem;
  --text-6xl:  3.75rem;

  --leading-tight:  1.2;
  --leading-normal: 1.6;
  --leading-loose:  1.8;

  /* Spacing */
  --space-xs:  0.25rem;
  --space-sm:  0.5rem;
  --space-md:  1rem;
  --space-lg:  1.5rem;
  --space-xl:  2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  --space-4xl: 6rem;

  /* Layout */
  --max-width:   1200px;
  --nav-height:  4rem;
  --gutter:      clamp(1rem, 4vw, 2rem);

  /* Motion */
  --ease-out:    cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --duration-fast:   150ms;
  --duration-normal: 300ms;
  --duration-slow:   500ms;

  /* Misc */
  --radius:    4px;
  --radius-lg: 8px;
}

/* =============================================
   Dark Mode
   ============================================= */
@media (prefers-color-scheme: dark) {
  :root {
    --color-bg:       #0a0a0a;
    --color-fg:       #eeeeee;
    --color-fg-muted: #999999;
    --color-border:   #2a2a2a;
    --color-surface:  #151515;

    --pattern-url:     url('../assets/pattern/pattern-dark.svg');
    --pattern-opacity: 0.04;
  }
}

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

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

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--font-weight-regular);
  line-height: var(--leading-normal);
  color: var(--color-fg);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  min-height: 100vh;
}

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

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

ul, ol {
  list-style: none;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
  border: none;
  background: none;
}

button {
  cursor: pointer;
}

/* =============================================
   Fear of Negative Space — Pattern Background
   ============================================= */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image: var(--pattern-url);
  background-repeat: repeat;
  background-size: 317px 755px;
  opacity: var(--pattern-opacity);
  pointer-events: none;
}

/* =============================================
   Typography
   ============================================= */
h1, h2, h3, h4, h5, h6 {
  font-weight: var(--font-weight-semibold);
  line-height: var(--leading-tight);
  letter-spacing: -0.01em;
}

h1 { font-size: var(--text-5xl); }
h2 { font-size: var(--text-4xl); }
h3 { font-size: var(--text-3xl); }
h4 { font-size: var(--text-2xl); }
h5 { font-size: var(--text-xl); }
h6 { font-size: var(--text-lg); }

p + p {
  margin-top: var(--space-md);
}

small {
  font-size: var(--text-sm);
}

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

/* =============================================
   Focus States — Accessibility
   ============================================= */
:focus-visible {
  outline: 2px solid var(--color-fg);
  outline-offset: 3px;
}

/* =============================================
   Links — Underline on Hover
   ============================================= */
a:not([class]) {
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: opacity var(--duration-fast) var(--ease-out);
}

a:not([class]):hover {
  opacity: 0.7;
}

/* =============================================
   Layout Utility
   ============================================= */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* =============================================
   Main Content — offset for fixed nav
   ============================================= */
main {
  padding-top: var(--nav-height);
}

/* =============================================
   Footer
   ============================================= */
.site-footer {
  padding: var(--space-lg) 0;
  border-top: 1px solid var(--color-border);
  font-size: var(--text-sm);
  color: var(--color-fg-muted);
}

.footer-container {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--gutter);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}

.footer-name {
  font-weight: var(--font-weight-medium);
  color: var(--color-fg);
  letter-spacing: 0.01em;
}

.footer-copy {
  letter-spacing: 0.01em;
}

.footer-instagram {
  justify-self: end;
  color: var(--color-fg-muted);
  transition: color var(--duration-fast) var(--ease-out);
  display: flex;
  align-items: center;
}

.footer-instagram:hover {
  color: var(--color-fg);
}

.footer-instagram svg {
  display: inline-block;
}

/* =============================================
   Lightbox — tap affordance
   ============================================= */
.glightbox {
  cursor: pointer;
}

/* =============================================
   Responsive Typography
   ============================================= */
@media (max-width: 768px) {
  h1 { font-size: var(--text-4xl); }
  h2 { font-size: var(--text-3xl); }
  h3 { font-size: var(--text-2xl); }
  h4 { font-size: var(--text-xl); }
}

@media (max-width: 480px) {
  h1 { font-size: var(--text-3xl); }
  h2 { font-size: var(--text-2xl); }
  h3 { font-size: var(--text-xl); }
}
