/* ==========================================================
   Rowan Hall — Portfolio
   Aesthetic: Digital Naturalist — dark editorial, warm earth tones
   Fonts: Syne (display) + Outfit (body)
   ========================================================== */

:root {
  --bg: #080808;
  --bg-elevated: #0e0e0d;
  --bg-card: #161614;
  --text: #ede9e3;
  --text-muted: #7d7a75;
  --accent: #c8553d;
  --accent-hover: #d9674f;
  --green: #4a9e7a;
  --border: rgba(237, 233, 227, 0.07);
  --border-strong: rgba(237, 233, 227, 0.14);
  --radius: 6px;
  --font-display: "Syne", sans-serif;
  --font-body: "Outfit", sans-serif;
  --container: 1200px;
  --gutter: 2.4rem;
}

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

html {
  font-size: 62.5%;
  scroll-behavior: smooth;
  scrollbar-color: var(--accent) var(--bg);
}

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

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

::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg);
}
::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 3px;
}

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

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.3s ease;
}

/* ===== GRAIN TEXTURE ===== */
.grain {
  position: fixed;
  inset: 0;
  z-index: 10000;
  pointer-events: none;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.7' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
}

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

/* ===== REVEAL ANIMATIONS ===== */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition:
    opacity 0.9s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* ===== SECTION LABEL ===== */
.section-label {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6rem;
  display: flex;
  align-items: center;
  gap: 1.6rem;
}

.section-label::after {
  content: "";
  flex: 1;
  max-width: 8rem;
  height: 1px;
  background: var(--accent);
  opacity: 0.4;
}

.section-label--center {
  justify-content: center;
}

.section-label--center::after {
  display: none;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 1.5rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  padding: 1.4rem 3.2rem;
  border-radius: var(--radius);
  cursor: pointer;
  transition:
    all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  border: none;
  position: relative;
}

.btn--primary {
  background: var(--accent);
  color: var(--text);
}

.btn--primary:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 10px 40px rgba(200, 85, 61, 0.25);
  color: var(--text);
}

.btn--ghost {
  background: transparent;
  color: var(--text-muted);
  padding: 1.4rem 2rem;
}

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

.btn--outline {
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--text);
}

.btn--outline:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

.btn--lg {
  font-size: 1.8rem;
  padding: 1.8rem 4.8rem;
}

/* ===== NAV ===== */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2.4rem 4rem;
  transition: all 0.4s ease;
}

.nav--scrolled {
  background: rgba(8, 8, 8, 0.82);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  padding: 1.6rem 4rem;
  border-bottom: 1px solid var(--border);
}

.nav__logo {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
}

.nav__links {
  display: flex;
  gap: 3.2rem;
}

.nav__links a {
  font-size: 1.4rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  position: relative;
}

.nav__links a::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.nav__links a:hover::after {
  width: 100%;
}

/* ===== HERO ===== */
.hero {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  position: relative;
  padding: 0 4rem;
  overflow: hidden;
}

.hero__bg {
  position: absolute;
  top: 10%;
  right: -8%;
  width: 55vmin;
  height: 55vmin;
  background: radial-gradient(
    ellipse at center,
    rgba(200, 85, 61, 0.07) 0%,
    rgba(74, 158, 122, 0.03) 50%,
    transparent 70%
  );
  border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
  filter: blur(60px);
  animation: morph 20s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes morph {
  0% {
    border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
    transform: rotate(0deg) scale(1);
  }
  33% {
    border-radius: 60% 40% 30% 70% / 50% 60% 40% 50%;
  }
  66% {
    border-radius: 30% 70% 50% 50% / 60% 40% 50% 60%;
  }
  100% {
    border-radius: 50% 50% 40% 60% / 40% 60% 50% 50%;
    transform: rotate(10deg) scale(1.08);
  }
}

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

.hero__greeting {
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--accent);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 1.6rem;
}

.hero__name {
  font-family: var(--font-display);
  font-size: clamp(6.4rem, 11vw, 15rem);
  font-weight: 800;
  line-height: 0.92;
  letter-spacing: -0.04em;
  margin-bottom: 2.8rem;
  background: linear-gradient(
    160deg,
    var(--text) 0%,
    rgba(237, 233, 227, 0.55) 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero__tagline {
  font-size: clamp(1.8rem, 2.4vw, 2.4rem);
  font-weight: 300;
  color: var(--text-muted);
  max-width: 460px;
  margin-bottom: 4.2rem;
  line-height: 1.5;
}

.hero__cta {
  display: flex;
  gap: 1.6rem;
  align-items: center;
}

.hero__scroll {
  position: absolute;
  bottom: 3.6rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  opacity: 0;
  animation: fadeInScroll 1s ease 2s forwards;
}

@keyframes fadeInScroll {
  to {
    opacity: 1;
  }
}

.hero__scroll span {
  font-size: 1rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--text-muted);
  writing-mode: vertical-lr;
}

.hero__scroll-line {
  width: 1px;
  height: 48px;
  background: linear-gradient(to bottom, var(--accent), transparent);
  animation: scrollPulse 2.2s ease-in-out infinite;
  transform-origin: top;
}

@keyframes scrollPulse {
  0%,
  100% {
    opacity: 0.2;
    transform: scaleY(0.5);
  }
  50% {
    opacity: 1;
    transform: scaleY(1);
  }
}

/* ===== ABOUT ===== */
.about {
  padding: 14rem 0 12rem;
  position: relative;
}

.about__grid {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 8rem;
  align-items: center;
}

.about__image-wrap {
  position: relative;
}

.about__image-wrap::before {
  content: "";
  position: absolute;
  inset: -14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  z-index: -1;
  transform: rotate(-2deg);
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.about__image-wrap:hover::before {
  transform: rotate(0deg);
}

.about__image {
  border-radius: var(--radius);
  width: 100%;
  object-fit: cover;
  aspect-ratio: 3 / 4;
  filter: grayscale(25%) brightness(0.95);
  transition: filter 0.6s ease;
}

.about__image-wrap:hover .about__image {
  filter: grayscale(0%) brightness(1);
}

.about__text {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.about__bio {
  color: var(--text-muted);
  font-size: 1.7rem;
  line-height: 1.85;
}

.about__bio--lead {
  color: var(--text);
  font-size: 2.1rem;
  font-weight: 400;
  line-height: 1.7;
}

.about .btn {
  align-self: flex-start;
  margin-top: 1.2rem;
}

/* ===== PROJECTS ===== */
.projects {
  padding: 12rem 0 14rem;
  background: var(--bg-elevated);
  position: relative;
}

/* subtle top/bottom borders */
.projects::before,
.projects::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--border-strong) 20%,
    var(--border-strong) 80%,
    transparent 100%
  );
}

.projects::before {
  top: 0;
}
.projects::after {
  bottom: 0;
}

.project {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 5rem;
  align-items: center;
  margin-bottom: 10rem;
}

.project:last-child {
  margin-bottom: 0;
}

.project--reverse {
  direction: rtl;
}

.project--reverse > * {
  direction: ltr;
}

.project__number {
  font-family: var(--font-display);
  font-size: 7rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 1.2rem;
  display: block;
  color: transparent;
  -webkit-text-stroke: 1px var(--border-strong);
}

.project__title {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 3vw, 3.4rem);
  font-weight: 700;
  margin-bottom: 1.8rem;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.project__desc {
  color: var(--text-muted);
  margin-bottom: 2.2rem;
  line-height: 1.85;
  font-size: 1.6rem;
}

.project__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-bottom: 2.8rem;
}

.project__tags span {
  font-size: 1.15rem;
  font-weight: 400;
  padding: 0.5rem 1.3rem;
  border: 1px solid var(--border-strong);
  border-radius: 100px;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  transition: all 0.3s ease;
}

.project__tags span:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.project__image-wrap {
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-card);
}

.project__image {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.project__image-wrap:hover .project__image {
  transform: scale(1.05);
}

.project__image--placeholder {
  width: 100%;
  aspect-ratio: 16 / 10;
  background: var(--bg-card);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===== CONTACT ===== */
.contact {
  padding: 16rem 0 12rem;
  text-align: center;
}

.contact__text {
  font-family: var(--font-display);
  font-size: clamp(3.2rem, 5.5vw, 5.6rem);
  font-weight: 700;
  margin-bottom: 4rem;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

/* ===== FOOTER ===== */
.footer {
  padding: 4rem 0;
  border-top: 1px solid var(--border);
}

.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer__socials {
  display: flex;
  gap: 2rem;
}

.footer__socials a {
  font-size: 2rem;
  color: var(--text-muted);
  transition: all 0.3s ease;
}

.footer__socials a:hover {
  color: var(--accent);
  transform: translateY(-3px);
}

.footer__copy {
  font-size: 1.3rem;
  color: var(--text-muted);
}

/* ==========================================================
   RESPONSIVE
   ========================================================== */

@media (max-width: 1024px) {
  .about__grid {
    gap: 5rem;
  }

  .project {
    gap: 4rem;
  }
}

@media (max-width: 900px) {
  .about__grid {
    grid-template-columns: 1fr;
    gap: 4rem;
  }

  .about__image-wrap {
    max-width: 320px;
    margin: 0 auto;
  }

  .about__text {
    text-align: center;
  }

  .about .btn {
    align-self: center;
  }

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

  .project--reverse {
    direction: ltr;
  }

  .project__number {
    font-size: 5rem;
  }
}

@media (max-width: 600px) {
  :root {
    --gutter: 2rem;
  }

  .hero {
    padding: 0 2rem;
  }

  .nav {
    padding: 1.6rem 2rem;
  }

  .nav--scrolled {
    padding: 1.2rem 2rem;
  }

  .nav__links {
    gap: 2rem;
  }

  .hero__name {
    font-size: clamp(5rem, 14vw, 8rem);
  }

  .hero__cta {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.2rem;
  }

  .hero__scroll {
    display: none;
  }

  .about {
    padding: 8rem 0;
  }

  .projects {
    padding: 8rem 0 10rem;
  }

  .contact {
    padding: 10rem 0 8rem;
  }

  .section-label {
    margin-bottom: 4rem;
  }

  .project {
    margin-bottom: 7rem;
  }

  .project__image {
    aspect-ratio: 16 / 9;
  }

  .footer__inner {
    flex-direction: column;
    gap: 2rem;
    text-align: center;
  }
}

@media (max-width: 380px) {
  .nav__links {
    gap: 1.4rem;
  }

  .nav__links a {
    font-size: 1.3rem;
  }

  .hero__tagline {
    font-size: 1.6rem;
  }

  .btn--lg {
    padding: 1.5rem 3.2rem;
    font-size: 1.6rem;
  }
}
