/* ============================================================
   Jake Lowy — Portfolio
   ============================================================ */

:root {
  --bg: #141417;
  --bg-soft: #1c1c21;
  --bg-card: #202027;
  --ink: #f4f1ec;
  --ink-dim: #b9b5ae;
  --accent: #2e8fae;
  --accent-soft: #7cc4da;
  --line: rgba(244, 241, 236, 0.12);
  --serif: "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --sans: "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --radius: 20px;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

h1, h2, h3 { font-family: var(--serif); font-weight: 700; line-height: 1.12; letter-spacing: -0.02em; }

section { padding: clamp(4rem, 9vw, 8rem) clamp(1.25rem, 6vw, 6rem); }

.eyebrow {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-soft);
  margin-bottom: 0.9rem;
}

.section-head { max-width: 720px; margin-bottom: clamp(2.5rem, 5vw, 4.5rem); }
.section-head h2 { font-size: clamp(2rem, 4.5vw, 3.2rem); }
.section-sub { color: var(--ink-dim); margin-top: 1rem; max-width: 54ch; }

/* ============ Nav ============ */

.nav {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  width: min(1080px, calc(100% - 2rem));
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.9rem 0.6rem 0.7rem;
  border-radius: 999px;
  background: rgba(36, 90, 116, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 100;
  transition: background 0.4s var(--ease), box-shadow 0.4s var(--ease);
}

.nav.scrolled {
  background: rgba(20, 20, 23, 0.75);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--ink);
}

.nav-logo-img {
  height: 44px;
  width: auto;
  padding-left: 0.4rem;
}

.nav-links { display: flex; align-items: center; gap: 0.4rem; }

.nav-links a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  transition: background 0.3s var(--ease);
}

.nav-links a:hover { background: rgba(255, 255, 255, 0.12); }

.nav-cta {
  background: var(--ink);
  color: var(--bg) !important;
}

.nav-cta:hover { background: #fff !important; }

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

.hero {
  position: relative;
  min-height: 92vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: 7rem;
  max-width: 1180px;
  margin: 0 auto;
}

.hero-glow {
  position: absolute;
  top: 8%;
  right: -10%;
  width: 60vw;
  height: 60vw;
  max-width: 800px;
  max-height: 800px;
  background: radial-gradient(circle at center, rgba(46, 143, 174, 0.18), transparent 65%);
  filter: blur(20px);
  pointer-events: none;
  animation: drift 14s ease-in-out infinite alternate;
}

@keyframes drift {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(-8%, 6%) scale(1.15); }
}

.hero-title {
  font-size: clamp(2.3rem, 6vw, 4.6rem);
  max-width: 20ch;
}

/* Padding + negative margin cancel out visually but stop the overflow
   clip from cutting descenders and italic overhangs. */
.hero-title .line {
  display: block;
  overflow: hidden;
  padding: 0.14em 0.12em;
  margin: -0.14em -0.12em;
}
.hero-title .line > span { display: inline-block; }

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

.hero-sub {
  margin-top: 1.8rem;
  max-width: 56ch;
  color: var(--ink-dim);
  font-size: 1.08rem;
}

.hero-sub strong { color: var(--ink); }

.hero-actions { display: flex; gap: 0.9rem; margin-top: 2.4rem; flex-wrap: wrap; }

.btn {
  display: inline-block;
  padding: 0.85rem 1.7rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  cursor: pointer;
  font-family: var(--sans);
  transition: transform 0.35s var(--ease), background 0.35s var(--ease),
              border-color 0.35s var(--ease), color 0.35s var(--ease);
}

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

.btn-primary { background: var(--ink); color: var(--bg); }
.btn-primary:hover { background: #fff; }

.btn-ghost { border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--accent-soft); color: var(--accent-soft); }

/* Hero entrance */
.reveal-hero,
.hero-title .line > span {
  opacity: 0;
  transform: translateY(110%);
  animation: heroUp 1.1s var(--ease) forwards;
  animation-delay: calc(var(--d, 0) * 0.12s + 0.15s);
}

.reveal-hero {
  transform: translateY(26px);
}

@keyframes heroUp {
  to { opacity: 1; transform: translateY(0); }
}

/* ============ Showcase grid ============ */

.showcase {
  padding-left: 0;
  padding-right: 0;
  overflow: hidden;
  background: linear-gradient(var(--bg), var(--bg-soft) 20%, var(--bg-soft) 80%, var(--bg));
}

.showcase-inner {
  display: flex;
  flex-direction: column;
  gap: clamp(1rem, 2.5vw, 2rem);
  transform: rotate(-2deg) scale(1.06);
}

.showcase-track {
  display: flex;
  gap: clamp(1rem, 2.5vw, 2rem);
  justify-content: center;
  will-change: transform;
}

.tile {
  position: relative;
  flex: 0 0 clamp(340px, 40vw, 580px);
  aspect-ratio: 16 / 10.5;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--bg-card);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
  transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease);
}

.tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  transition: transform 0.6s var(--ease);
}

.tile:hover { transform: translateY(-8px); box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5); }
.tile:hover img { transform: scale(1.05); }

.tile-label {
  position: absolute;
  inset: auto 0 0 0;
  padding: 2.2rem 1.2rem 1rem;
  background: linear-gradient(transparent, rgba(10, 10, 14, 0.85));
  color: #fff;
  font-weight: 600;
  font-size: 1.02rem;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease);
}

.tile-label small {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-soft);
}

.tile:hover .tile-label { opacity: 1; transform: translateY(0); }

/* ============ Projects ============ */

.projects { max-width: 1180px; margin: 0 auto; }

.project {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
  padding: clamp(2.5rem, 5vw, 4.5rem) 0;
  border-top: 1px solid var(--line);
  scroll-margin-top: 7rem;
}

.project:nth-of-type(even) .project-media { order: 2; }

.project-media {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
  transition: transform 0.6s var(--ease);
}

.project-media:hover { transform: translateY(-6px) rotate(-0.5deg); }

.project-media img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: top; }

.chip {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-soft);
  border: 1px solid rgba(124, 196, 218, 0.35);
  border-radius: 999px;
  padding: 0.35rem 0.9rem;
  margin-bottom: 1.1rem;
}

.project-body h3 { font-size: clamp(1.7rem, 3vw, 2.4rem); margin-bottom: 1rem; }
.project-body > p { color: var(--ink-dim); }

.project-points {
  margin: 1.3rem 0 1.5rem;
  list-style: none;
  display: grid;
  gap: 0.55rem;
}

.project-points li {
  padding-left: 1.5rem;
  position: relative;
  color: var(--ink-dim);
  font-size: 0.97rem;
}

.project-points li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--accent-soft);
}

.project-links { margin-top: 1.5rem; }

.btn-sm { padding: 0.6rem 1.3rem; font-size: 0.92rem; }

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

.tags span {
  font-size: 0.82rem;
  font-weight: 500;
  padding: 0.35rem 0.85rem;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
}

/* ============ Skills ============ */

.skills { background: var(--bg-soft); }
.skills .section-head, .skills-grid { max-width: 1180px; margin-left: auto; margin-right: auto; }

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

.skill-col {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.8rem;
  transition: transform 0.5s var(--ease), border-color 0.5s var(--ease);
}

.skill-col:hover { transform: translateY(-6px); border-color: rgba(124, 196, 218, 0.4); }

.skill-col h4 {
  font-family: var(--serif);
  font-size: 1.3rem;
  margin-bottom: 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.skill-icon { color: var(--accent-soft); font-size: 1.1rem; }

.skill-col ul { list-style: none; display: grid; gap: 0.55rem; }

.skill-col li {
  color: var(--ink-dim);
  padding-left: 1.4rem;
  position: relative;
  font-size: 0.97rem;
}

.skill-col li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

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

.about {
  max-width: 1080px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: clamp(2.5rem, 5vw, 4.5rem);
  align-items: center;
}

.about-photo img {
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
  transform: rotate(-2deg);
  transition: transform 0.6s var(--ease);
}

.about-photo img:hover { transform: rotate(0deg) scale(1.02); }

.about-body h2 { font-size: clamp(2rem, 4vw, 3rem); margin-bottom: 1.2rem; }
.about-body p { color: var(--ink-dim); margin-bottom: 1.1rem; }
.about-body strong { color: var(--ink); }
.about-body .btn { margin-top: 0.8rem; }

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

.contact { background: var(--bg-soft); }
.contact .section-head, .contact-form { max-width: 720px; margin-left: auto; margin-right: auto; }

.contact-form { display: grid; gap: 1.2rem; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }

.contact-form label {
  display: grid;
  gap: 0.45rem;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

.contact-form input,
.contact-form textarea {
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.9rem 1.1rem;
  transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
  resize: vertical;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--accent-soft);
  box-shadow: 0 0 0 4px rgba(46, 143, 174, 0.18);
}

.contact-form .btn { justify-self: start; }

.hidden-field { display: none; }

.form-success {
  font-family: var(--serif);
  font-size: 1.4rem;
  color: var(--accent-soft);
  text-align: center;
  padding: 2rem 0;
}

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

.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 2.2rem clamp(1.25rem, 6vw, 6rem);
  border-top: 1px solid var(--line);
  color: var(--ink-dim);
  font-size: 0.92rem;
}

.footer a { color: var(--ink); text-decoration: none; }
.footer a:hover { color: var(--accent-soft); }

.footer-logo { height: 38px; width: auto; }

.footer-links { display: flex; align-items: center; gap: 1.1rem; }

.footer-links a {
  display: grid;
  place-items: center;
  color: var(--ink-dim);
  transition: color 0.3s var(--ease), transform 0.3s var(--ease);
}

.footer-links a:hover { color: var(--accent-soft); transform: translateY(-2px); }

/* ============ Scroll reveal ============ */

.reveal {
  opacity: 0;
  transform: translateY(34px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}

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

/* ============ Responsive ============ */

@media (max-width: 900px) {
  .project, .project:nth-of-type(even) { grid-template-columns: 1fr; }
  .project:nth-of-type(even) .project-media { order: 0; }
  .about { grid-template-columns: 1fr; }
  .about-photo { max-width: 320px; }
  .form-row { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .nav-logo-img { height: 34px; }
  .nav-links a:not(.nav-cta) { padding: 0.5rem 0.6rem; font-size: 0.88rem; }
  .tile { flex-basis: 300px; }
}

/* ============ Reduced motion ============ */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal, .reveal-hero, .hero-title .line > span { opacity: 1; transform: none; }
}
