/* ============================================================
   Ben Grant — Portfolio
   style.css
   ============================================================ */

/* ============================
   1. Variables & Reset
   ============================ */
:root {
  /* Colours */
  --bg:           #FAFAF8;
  --bg-warm:      #F5EDE0;
  --text:         #1C1C1A;
  --text-muted:   #6B6860;
  --accent:       #F97316;
  --accent-dark:  #C2550F;
  --border:       #E8DDD0;
  --card-bg:      #FFFFFF;

  /* Typography */
  --font-serif: 'DM Serif Display', Georgia, 'Times New Roman', serif;
  --font-sans:  'DM Sans', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;

  /* Layout */
  --max-width:       1100px;
  --spacing-section: clamp(5rem, 10vw, 9rem);
  --radius:          14px;
  --radius-sm:       8px;
  --radius-pill:     100px;

  /* Motion */
  --ease-out:  cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in:   cubic-bezier(0.7, 0, 0.84, 0);
  --ease:      cubic-bezier(0.4, 0, 0.2, 1);
  --dur:       0.32s;
}

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

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

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 1rem;
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

ul {
  list-style: none;
}

/* ============================
   2. Custom Scrollbar
   ============================ */
::-webkit-scrollbar        { width: 5px; }
::-webkit-scrollbar-track  { background: var(--bg); }
::-webkit-scrollbar-thumb  { background: var(--accent); border-radius: 99px; }

/* ============================
   3. Focus States
   ============================ */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: var(--radius-sm);
}

/* ============================
   4. Custom Cursor
   ============================ */
.cursor {
  width: 12px;
  height: 12px;
  background: var(--accent);
  border-radius: 50%;
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0;
  mix-blend-mode: multiply;
  transition:
    width  0.22s var(--ease-out),
    height 0.22s var(--ease-out),
    background 0.22s var(--ease),
    opacity 0.3s var(--ease);
  will-change: transform;
}

.cursor.large {
  width: 40px;
  height: 40px;
  background: rgba(249, 115, 22, 0.18);
}

/* Hide on touch devices */
@media (hover: none) {
  .cursor { display: none; }
}

/* ============================
   5. Navigation
   ============================ */
.site-header {
  position: fixed;
  inset-block-start: 0;
  inset-inline: 0;
  z-index: 100;
  padding: 1.5rem 2rem;
  transition:
    background var(--dur) var(--ease),
    border-color var(--dur) var(--ease),
    backdrop-filter var(--dur) var(--ease);
  border-bottom: 1px solid transparent;
}

.site-header.scrolled {
  background: rgba(250, 250, 248, 0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-color: var(--border);
}

.nav {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-logo {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.01em;
  transition: color var(--dur) var(--ease);
}

.nav-logo:hover {
  color: var(--accent);
}

.nav-links {
  display: flex;
  gap: 2rem;
}

.nav-links a {
  position: relative;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.025em;
  transition: color var(--dur) var(--ease);
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  width: 0;
  height: 1.5px;
  background: var(--accent);
  border-radius: 99px;
  transition: width 0.35s var(--ease-out);
}

.nav-links a:hover {
  color: var(--text);
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

/* ============================
   6. Container
   ============================ */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
}

/* ============================
   7. Scroll-Reveal Utility
   ============================ */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition:
    opacity  0.75s var(--ease-out),
    transform 0.75s var(--ease-out);
  transition-delay: var(--delay, 0s);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================
   8. Buttons
   ============================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.8rem 1.8rem;
  border-radius: var(--radius-pill);
  font-family: var(--font-sans);
  font-size: 0.925rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition:
    background var(--dur) var(--ease),
    color var(--dur) var(--ease),
    border-color var(--dur) var(--ease),
    transform 0.2s var(--ease-out),
    box-shadow 0.2s var(--ease-out);
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border: 2px solid var(--accent);
}

.btn-primary:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
  box-shadow: 0 10px 28px rgba(249, 115, 22, 0.32);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 2px solid var(--border);
}

.btn-ghost:hover {
  border-color: var(--text);
}

/* ============================
   9. Section Label
   ============================ */
.section-label {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

/* ============================
   10. Hero
   ============================ */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding: 8rem 2rem 5rem;
}

.hero-inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
}

/* Staggered entrance animations */
.hero-eyebrow,
.hero-name,
.hero-tagline,
.hero-bio,
.hero-ctas {
  opacity: 0;
  animation: heroFadeUp 0.9s var(--ease-out) forwards;
}

.hero-eyebrow { animation-delay: 0.05s; }
.hero-name    { animation-delay: 0.2s;  }
.hero-tagline { animation-delay: 0.38s; }
.hero-bio     { animation-delay: 0.54s; }
.hero-ctas    { animation-delay: 0.7s;  }

@keyframes heroFadeUp {
  from {
    opacity: 0;
    transform: translateY(22px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 2rem;
}

/* Pulsing green "available" dot */
.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: #22C55E;
  border-radius: 50%;
  animation: statusPulse 2.4s ease-in-out infinite;
}

@keyframes statusPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5); }
  50%       { box-shadow: 0 0 0 7px rgba(34, 197, 94, 0); }
}

.hero-name {
  font-family: var(--font-serif);
  font-size: clamp(3.5rem, 9vw, 7.5rem);
  letter-spacing: -0.035em;
  line-height: 0.95;
  margin-bottom: 1.5rem;
}

.hero-tagline {
  font-family: var(--font-serif);
  font-size: clamp(1.45rem, 3.2vw, 2.4rem);
  line-height: 1.3;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.hero-tagline em {
  color: var(--accent);
  font-style: italic;
}

.hero-bio {
  font-size: 1.05rem;
  color: var(--text-muted);
  line-height: 1.75;
  max-width: 460px;
  margin-bottom: 2.75rem;
}

.hero-ctas {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ---- Decorative rings ---- */
.hero-decoration {
  position: absolute;
  right: -4%;
  top: 50%;
  transform: translateY(-50%);
  width: 520px;
  height: 520px;
  pointer-events: none;
  opacity: 0;
  animation: fadeIn 1.5s var(--ease-out) 0.9s forwards;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.deco-ring {
  position: absolute;
  border-radius: 50%;
  border-style: solid;
}

.deco-ring-1 {
  inset: 0;
  border-width: 1px;
  border-color: var(--border);
  animation: rotateCW 38s linear infinite;
}

.deco-ring-2 {
  inset: 80px;
  border-width: 1px;
  border-color: rgba(249, 115, 22, 0.22);
  animation: rotateCCW 24s linear infinite;
}

@keyframes rotateCW {
  to { transform: rotate(360deg); }
}

@keyframes rotateCCW {
  to { transform: rotate(-360deg); }
}

/* Small orbital dots on the rings */
.deco-dot {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.deco-dot-1 {
  top: -4px;
  left: 50%;
  margin-left: -4px;
  animation: rotateCW 38s linear infinite;
  transform-origin: 4px calc(260px + 4px);
}

.deco-dot-2 {
  top: 76px;
  left: 50%;
  margin-left: -4px;
  background: rgba(249, 115, 22, 0.45);
  animation: rotateCCW 24s linear infinite;
  transform-origin: 4px calc(180px + 4px);
}

/* ============================
   11. Work / Projects
   ============================ */
.work {
  padding-block: var(--spacing-section);
}

.section-header {
  margin-bottom: 3rem;
}

.section-title {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 4.5vw, 3rem);
  letter-spacing: -0.025em;
  line-height: 1.1;
}

/* 2-column grid, collapses to 1 on mobile */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 480px), 1fr));
  gap: 1.25rem;
}

.project-card {
  position: relative;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition:
    transform 0.3s var(--ease-out),
    box-shadow 0.3s var(--ease-out),
    border-color 0.3s var(--ease);
}

/* Orange top bar on hover */
.project-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), #FBBF24);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.45s var(--ease-out);
}

.project-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.09);
  border-color: rgba(249, 115, 22, 0.15);
}

.project-card:hover::before {
  transform: scaleX(1);
}

.project-card-inner {
  padding: 2rem;
}

.project-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.2rem;
}

.project-number {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
}

.project-tags {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.tag {
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--bg-warm);
  padding: 0.18rem 0.6rem;
  border-radius: var(--radius-pill);
  letter-spacing: 0.04em;
}

.project-title {
  font-family: var(--font-serif);
  font-size: 1.85rem;
  letter-spacing: -0.025em;
  line-height: 1.1;
  margin-bottom: 0.7rem;
}

.project-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 1.6rem;
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
  transition: gap 0.25s var(--ease-out), color var(--dur) var(--ease);
}

.project-link svg {
  transition: transform 0.25s var(--ease-out);
}

.project-link:hover {
  gap: 0.65rem;
}

.project-link:hover svg {
  transform: translateX(3px);
}

/* ============================
   12. Contact
   ============================ */
.contact {
  padding-block: var(--spacing-section);
  background: var(--bg-warm);
  border-top: 1px solid var(--border);
}

.contact-inner {
  max-width: 640px;
}

.contact-title {
  font-family: var(--font-serif);
  font-size: clamp(2.75rem, 6vw, 4.5rem);
  letter-spacing: -0.035em;
  line-height: 1.05;
  margin-bottom: 1.5rem;
}

.contact-title em {
  color: var(--accent);
  font-style: italic;
}

.contact-desc {
  font-size: 1.05rem;
  color: var(--text-muted);
  line-height: 1.75;
  max-width: 480px;
  margin-bottom: 2.25rem;
}

.contact-email {
  display: inline-block;
  font-size: clamp(1rem, 2.2vw, 1.3rem);
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  padding-bottom: 3px;
  border-bottom: 2px solid var(--accent);
  margin-bottom: 2.5rem;
  word-break: break-all;
  transition: color var(--dur) var(--ease);
}

.contact-email:hover {
  color: var(--accent);
}

.contact-links {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
}

.social-link {
  position: relative;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: color var(--dur) var(--ease);
}

.social-link::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  width: 0;
  height: 1.5px;
  background: var(--accent);
  border-radius: 99px;
  transition: width 0.35s var(--ease-out);
}

.social-link:hover {
  color: var(--accent);
}

.social-link:hover::after {
  width: 100%;
}

/* ============================
   13. Footer
   ============================ */
.site-footer {
  padding: 2rem;
  border-top: 1px solid var(--border);
}

.site-footer .container {
  display: flex;
  justify-content: center;
}

.site-footer p {
  font-size: 0.78rem;
  color: var(--text-muted);
  letter-spacing: 0.03em;
}

/* ============================
   14. Scroll Hint
   ============================ */
.scroll-hint {
  position: absolute;
  bottom: 2.5rem;
  left: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  opacity: 0;
  animation: heroFadeUp 0.9s var(--ease-out) 1s forwards;
}

.scroll-hint-label {
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
  writing-mode: vertical-lr;
}

.scroll-hint-line {
  width: 1px;
  height: 52px;
  background: var(--border);
  position: relative;
  overflow: hidden;
  border-radius: 99px;
}

.scroll-hint-line::after {
  content: '';
  position: absolute;
  top: -100%;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, var(--accent), transparent);
  animation: scrollDrop 2s var(--ease-in) infinite;
  animation-delay: 1.2s;
}

@keyframes scrollDrop {
  0%   { transform: translateY(0);    opacity: 0; }
  15%  { opacity: 1; }
  100% { transform: translateY(200%); opacity: 0; }
}

/* ============================
   15. Marquee Ticker
   ============================ */
.marquee {
  overflow: hidden;
  padding: 1.1rem 0;
  background: var(--bg-warm);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  user-select: none;
}

.marquee-track {
  display: flex;
  width: max-content;
  animation: marqueeScroll 30s linear infinite;
}

.marquee:hover .marquee-track {
  animation-play-state: paused;
}

.marquee-set {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding-right: 1.25rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.marquee-set span {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1rem;
  color: var(--text-muted);
}

.marquee-sep {
  color: var(--accent) !important;
  font-style: normal !important;
  opacity: 0.5;
}

@keyframes marqueeScroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ============================
   16. About Section
   ============================ */
.about {
  padding-block: var(--spacing-section);
  border-top: 1px solid var(--border);
}

.about-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 6vw, 5rem);
  align-items: start;
}

.about-heading {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 4vw, 3rem);
  letter-spacing: -0.025em;
  line-height: 1.1;
  margin-bottom: 1.25rem;
  margin-top: 0.5rem;
}

.about-heading em {
  color: var(--accent);
  font-style: italic;
}

.about-body {
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.85;
  max-width: 42ch;
}

.skills-label {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
  display: block;
}

.skills-list {
  list-style: none;
}

.skills-list li {
  font-size: 0.975rem;
  color: var(--text);
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  cursor: default;
  transition:
    color var(--dur) var(--ease),
    padding-left 0.3s var(--ease-out);
}

.skills-list li:first-child {
  border-top: 1px solid var(--border);
}

.skills-list li::before {
  content: '\2192';
  color: var(--accent);
  font-size: 0.8rem;
  opacity: 0;
  flex-shrink: 0;
  transition: opacity var(--dur) var(--ease);
}

.skills-list li:hover {
  color: var(--accent);
  padding-left: 0.4rem;
}

.skills-list li:hover::before {
  opacity: 1;
}

/* ============================
   17. Card Preview Blocks
   ============================ */
.card-preview {
  height: 128px;
  border-radius: var(--radius) var(--radius) 0 0;
  position: relative;
  overflow: hidden;
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, 0.45) 1px, transparent 1px),
    var(--preview-gradient);
  background-size: 22px 22px, 100% 100%;
}

.card-preview--bloom {
  --preview-gradient: linear-gradient(135deg, #FCE7F3 0%, #FDE68A 100%);
}

.card-preview--tideline {
  --preview-gradient: linear-gradient(135deg, #BFDBFE 0%, #6EE7B7 100%);
}

.card-preview--morrow {
  --preview-gradient: linear-gradient(135deg, #F1F5F9 0%, #E2E8F0 100%);
  background-image:
    radial-gradient(circle, rgba(0, 0, 0, 0.06) 1px, transparent 1px),
    var(--preview-gradient);
  background-size: 22px 22px, 100% 100%;
}

.card-preview--forge {
  --preview-gradient: linear-gradient(135deg, #1C1C1A 0%, #7C2D12 55%, #F97316 100%);
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    var(--preview-gradient);
  background-size: 22px 22px, 100% 100%;
}

/* Orange top-bar renders above preview block */
.project-card::before {
  z-index: 1;
}

/* ============================
   18. Responsive
   ============================ */
@media (max-width: 900px) {
  .hero-decoration { display: none; }

  .about-inner {
    grid-template-columns: 1fr;
    gap: 3rem;
  }
}

@media (max-width: 768px) {
  .site-header { padding: 1.25rem 1.5rem; }

  .hero {
    padding: 7rem 1.5rem 5rem;
    min-height: 95svh;
  }

  .scroll-hint { left: 1.5rem; }

  .container { padding: 0 1.5rem; }

  .contact-inner { max-width: 100%; }
}

@media (max-width: 480px) {
  .hero-ctas {
    flex-direction: column;
  }

  .btn {
    justify-content: center;
    text-align: center;
  }

  .scroll-hint { display: none; }
}

/* ============================
   19. Reduced Motion
   ============================ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  .cursor { display: none; }

  .hero-eyebrow,
  .hero-name,
  .hero-tagline,
  .hero-bio,
  .hero-ctas,
  .hero-decoration {
    animation: none;
    opacity: 1;
    transform: none;
  }

  .reveal {
    transition: none;
    opacity: 1;
    transform: none;
  }

  .deco-ring,
  .deco-dot,
  .status-dot,
  .scroll-hint-line::after,
  .marquee-track {
    animation: none;
  }

  .scroll-hint {
    animation: none;
    opacity: 1;
  }

  .project-card,
  .project-card::before,
  .btn,
  .project-link,
  .nav-links a::after,
  .social-link::after,
  .skills-list li {
    transition: none;
  }
}
