/* ============================================================
   Omid Habib — Portfolio
   Gallery-paper minimal · Fraunces + Inter · ink & vermilion
   ============================================================ */

:root {
  --paper: #faf7f2;
  --paper-deep: #f3eee5;
  --ink: #181512;
  --ink-soft: #5c554c;
  --line: #e2dbcf;
  --accent: #e84b1f;
  --accent-deep: #c33a12;

  --font-display: "Fraunces", georgia, serif;
  --font-body: "Inter", -apple-system, sans-serif;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --space: clamp(1.25rem, 4vw, 3rem);
}

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

html {
  scroll-behavior: smooth;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

em {
  font-style: italic;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space);
  z-index: 100;
  background: var(--ink);
  color: var(--paper);
  padding: 0.6rem 1rem;
  text-decoration: none;
  border-radius: 0 0 6px 6px;
}

.skip-link:focus {
  top: 0;
}

/* ============ Custom cursor (desktop, motion-allowed only) ============ */

.cursor {
  display: none;
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .cursor {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent);
    pointer-events: none;
    z-index: 99;
    transform: translate(-50%, -50%);
    transition: width 0.25s var(--ease-out), height 0.25s var(--ease-out),
      opacity 0.25s;
    opacity: 0;
    mix-blend-mode: multiply;
  }

  .cursor.is-visible {
    opacity: 1;
  }

  .cursor.is-hovering {
    width: 44px;
    height: 44px;
    opacity: 0.35;
  }
}

/* ============ Reveal on scroll ============ */

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
}

.reveal.is-in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

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

  .marquee__track {
    animation: none !important;
  }

  .hero__star,
  .art__flower,
  .marquee__flower {
    animation: none !important;
  }
}

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

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.1rem var(--space);
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.nav__wordmark {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.2rem;
  text-decoration: none;
  letter-spacing: -0.01em;
}

.nav__dot {
  color: var(--accent);
}

.nav__links {
  display: flex;
  gap: clamp(1rem, 3vw, 2.25rem);
}

.nav__links a {
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ink-soft);
  padding: 0.5rem 0.15rem;
  position: relative;
  transition: color 0.2s;
}

.nav__links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0.25rem;
  width: 100%;
  height: 1.5px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.3s var(--ease-out);
}

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

.nav__links a:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

.nav__status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.5rem 1rem;
  white-space: nowrap;
  transition: border-color 0.25s, color 0.25s;
}

.nav__status:hover {
  border-color: var(--accent);
  color: var(--ink);
}

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

.hero {
  min-height: calc(100dvh - 70px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(3rem, 8vh, 6rem) var(--space) clamp(3rem, 7vh, 5rem);
}

.hero__title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(3.2rem, 12.5vw, 11rem);
  line-height: 0.98;
  letter-spacing: -0.03em;
}

.hero__line {
  display: block;
}

.hero__accent {
  color: var(--accent);
  font-style: italic;
  font-weight: 350;
  position: relative;
  white-space: nowrap;
}

.hero__star {
  width: 0.38em;
  height: 0.38em;
  color: var(--ink);
  vertical-align: super;
  margin-left: 0.06em;
  animation: spin 14s linear infinite;
}

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

.hero__footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
  margin-top: clamp(2.5rem, 7vh, 5rem);
}

.hero__sub {
  max-width: 26rem;
  font-size: 1.05rem;
  color: var(--ink-soft);
}

.hero__cta {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  padding: 0.9rem 1.6rem;
  transition: background 0.25s var(--ease-out), color 0.25s var(--ease-out),
    transform 0.25s var(--ease-out);
}

.hero__cta svg {
  width: 1em;
  height: 1em;
  transition: transform 0.25s var(--ease-out);
}

.hero__cta:hover {
  background: var(--ink);
  color: var(--paper);
  transform: translateY(-2px);
}

.hero__cta:hover svg {
  transform: translateY(3px);
}

/* ============ Marquee ============ */

.marquee {
  overflow: hidden;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 1.1rem 0;
  background: var(--paper-deep);
}

.marquee__track {
  display: flex;
  align-items: center;
  gap: 2.5rem;
  width: max-content;
  animation: marquee 60s linear infinite;
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-style: italic;
  font-weight: 350;
}

.marquee__track span {
  white-space: nowrap;
}

.marquee__flower {
  flex: none;
  width: 1.15rem;
  height: 1.15rem;
  color: var(--accent);
  animation: spin 24s linear infinite;
}

@keyframes marquee {
  to {
    transform: translateX(-50%);
  }
}

/* ============ Section heads ============ */

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-bottom: clamp(2.5rem, 6vh, 4.5rem);
}

.section-head__title {
  font-family: var(--font-display);
  font-weight: 450;
  font-size: clamp(2.2rem, 6vw, 4.5rem);
  letter-spacing: -0.02em;
  line-height: 1.05;
}

.section-head__title em {
  color: var(--accent);
  font-weight: 350;
}

.section-head__count {
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* ============ L'Art — classic French interlude ============ */

.art {
  padding: clamp(4rem, 10vh, 8rem) var(--space);
  max-width: 980px;
  margin-inline: auto;
}

.art__frame {
  position: relative;
  border: 1px solid var(--line);
  padding: clamp(2.5rem, 7vw, 5.5rem) clamp(1.5rem, 6vw, 5rem);
  text-align: center;
  background: var(--paper);
}

/* inner rule — the classic double frame of a French gallery card */
.art__frame::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid var(--line);
  pointer-events: none;
}

.art__fleuron {
  display: block;
  font-size: 1.6rem;
  color: var(--accent);
  line-height: 1;
}

.art__fleuron--end {
  margin-top: 2.5rem;
  transform: scaleY(-1);
}

.art__label {
  margin-top: 1.2rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.art__quote p {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 350;
  font-size: clamp(1.7rem, 4.5vw, 3.1rem);
  line-height: 1.25;
  letter-spacing: -0.01em;
  max-width: 22em;
  margin: clamp(1.5rem, 4vh, 2.5rem) auto 0;
}

.art__translation {
  margin-top: 0.6rem;
  font-size: 0.92rem;
  color: var(--ink-soft);
  font-style: italic;
}

.art__flowers {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: clamp(1.5rem, 5vw, 3.5rem);
  margin-top: clamp(2rem, 5vh, 3.5rem);
  color: var(--ink);
}

.art__flower {
  height: clamp(80px, 12vw, 120px);
  width: auto;
  transform-origin: 50% 100%;
  animation: sway 7s ease-in-out infinite;
}

/* each flower on its own rhythm, like a breeze passing through */
.art__flower:nth-child(1) {
  animation-duration: 8s;
}

.art__flower:nth-child(2) {
  animation-duration: 6s;
  animation-delay: -2.5s;
}

.art__flower:nth-child(3) {
  animation-duration: 9s;
  animation-delay: -5s;
}

@keyframes sway {
  0%,
  100% {
    transform: rotate(-2.2deg);
  }
  50% {
    transform: rotate(2.2deg);
  }
}

.art__flower--accent {
  color: var(--accent);
  height: clamp(95px, 14vw, 140px);
}

.art__body {
  max-width: 34rem;
  margin: clamp(2rem, 5vh, 3.5rem) auto 0;
  display: grid;
  gap: 1.1rem;
  color: var(--ink-soft);
  font-size: 1.02rem;
}

.art__body em {
  font-family: var(--font-display);
  color: var(--ink);
}

/* ============ Craft ============ */

.craft {
  background: var(--ink);
  color: var(--paper);
  padding: clamp(5rem, 12vh, 9rem) var(--space);
}

.craft__quote p {
  font-family: var(--font-display);
  font-weight: 350;
  font-size: clamp(2rem, 6vw, 4.6rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
  max-width: 18em;
  margin-inline: auto;
  text-align: center;
}

.craft__quote em {
  color: var(--accent);
}

.craft__body {
  max-width: 38rem;
  margin: clamp(2.5rem, 6vh, 4rem) auto 0;
  display: grid;
  gap: 1.25rem;
  color: #cfc8bd;
  font-size: 1.08rem;
  text-align: center;
}

.craft__body em {
  color: var(--paper);
}

.craft__services {
  list-style: none;
  padding: 0;
  max-width: 1100px;
  margin: clamp(3.5rem, 9vh, 6rem) auto 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.5rem;
  border-top: 1px solid #3a352e;
  padding-top: clamp(2.5rem, 6vh, 4rem);
}

.craft__index {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--accent);
  font-size: 1.1rem;
}

.craft__services h3 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.45rem;
  margin: 0.6rem 0 0.5rem;
  letter-spacing: -0.01em;
}

.craft__services p {
  color: #b5ada0;
  font-size: 0.97rem;
}

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

.contact {
  padding: clamp(4.5rem, 11vh, 8.5rem) var(--space);
  max-width: 1200px;
  margin-inline: auto;
}

.contact .section-head {
  display: block;
}

.contact__lede {
  margin-top: 1.2rem;
  color: var(--ink-soft);
  max-width: 30rem;
  font-size: 1.05rem;
}

.form {
  max-width: 46rem;
  display: grid;
  gap: 1.75rem;
}

.form__honey {
  display: none;
}

.form__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.75rem;
}

.form__field {
  display: grid;
  gap: 0.5rem;
}

.form__field label {
  font-weight: 600;
  font-size: 0.95rem;
}

.form__req {
  color: var(--accent);
}

.form__field input,
.form__field textarea {
  font: inherit;
  color: var(--ink);
  background: transparent;
  border: none;
  border-bottom: 1.5px solid var(--line);
  padding: 0.7rem 0.1rem;
  border-radius: 0;
  transition: border-color 0.25s;
  resize: vertical;
  min-height: 44px;
}

.form__field input:focus,
.form__field textarea:focus {
  outline: none;
  border-bottom-color: var(--accent);
}

.form__field.has-error input,
.form__field.has-error textarea {
  border-bottom-color: #c0271b;
}

.form__hint {
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.form__error {
  font-size: 0.85rem;
  color: #c0271b;
  min-height: 1.1em;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.form__error:not(:empty)::before {
  content: "";
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #c0271b;
}

.form__submit {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  font: inherit;
  font-weight: 600;
  color: var(--paper);
  background: var(--ink);
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  padding: 1rem 2rem;
  cursor: pointer;
  transition: background 0.25s var(--ease-out), transform 0.25s var(--ease-out),
    border-color 0.25s;
  min-height: 48px;
}

.form__submit:hover:not(:disabled) {
  background: var(--accent);
  border-color: var(--accent);
  transform: translateY(-2px);
}

.form__submit:disabled {
  opacity: 0.6;
  cursor: progress;
}

.form__submit-spinner {
  display: none;
  width: 1em;
  height: 1em;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.form.is-sending .form__submit-spinner {
  display: inline-block;
}

.form__status {
  font-weight: 500;
  min-height: 1.4em;
}

.form__status.is-success {
  color: #1c7a3d;
}

.form__status.is-error {
  color: #c0271b;
}

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

.footer {
  border-top: 1px solid var(--line);
  padding: clamp(2rem, 5vh, 3.5rem) var(--space) 2rem;
  overflow: hidden;
}

.footer__big {
  font-family: var(--font-display);
  font-weight: 450;
  font-size: clamp(3.5rem, 14vw, 13rem);
  letter-spacing: -0.03em;
  line-height: 1;
  white-space: nowrap;
  color: var(--paper-deep);
  -webkit-text-stroke: 1px var(--line);
  user-select: none;
  text-align: center;
}

.footer__row {
  display: flex;
  justify-content: space-between;
  gap: 1rem 2rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.footer__row a {
  color: var(--ink-soft);
  text-decoration-color: var(--line);
  text-underline-offset: 3px;
  transition: color 0.2s;
  padding: 0.25rem 0;
}

.footer__row a:hover {
  color: var(--accent);
}

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

@media (max-width: 880px) {
  .craft__services {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

@media (max-width: 760px) {
  .nav__status {
    display: none;
  }

  .piece,
  .form__row {
    grid-template-columns: 1fr;
  }

  .piece--flip .piece__cover {
    order: 0;
  }

  .hero__footer {
    flex-direction: column;
    align-items: flex-start;
  }
}
