/* =========================================================
   Vellum — Editorial Writer Portfolio
   Design tokens + shared styles
   ========================================================= */

:root {
  /* Palette */
  --bg: hsl(30, 25%, 95%);
  --bg-deep: hsl(30, 20%, 92%);
  --ink: hsl(30, 10%, 15%);
  --ink-soft: hsl(30, 10%, 30%);
  --ink-body: hsl(30, 10%, 35%);
  --muted: hsl(30, 10%, 50%);
  --faint: hsl(30, 10%, 60%);
  --gold: hsl(42, 70%, 50%);
  --gold-dark: hsl(42, 70%, 45%);
  --border: hsl(30, 15%, 88%);
  --border-strong: hsl(30, 15%, 80%);
  --card: hsl(30, 20%, 92%);
  --footer: hsl(30, 15%, 12%);

  /* Type */
  --serif: "Playfair Display", ui-serif, Georgia, serif;
  --sans: "Rubik", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;

  /* Layout */
  --nav-h: 44px;
  --maxw: 64rem;

  --ease: cubic-bezier(0.16, 1, 0.32, 1);
}

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

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

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

button {
  font: inherit;
  cursor: pointer;
}

::selection {
  background: var(--gold);
  color: #fff;
}

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ---------------------------------------------------------
   Top navigation
   --------------------------------------------------------- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 60;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(246, 242, 236, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.site-nav__links {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.site-nav a {
  font-family: var(--sans);
  font-size: 0.875rem;
  letter-spacing: 0.03em;
  color: var(--muted);
  transition: color 0.25s var(--ease);
}

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

.site-nav a.is-active {
  color: var(--ink);
}

/* ---------------------------------------------------------
   Star marker
   --------------------------------------------------------- */
.star {
  color: hsl(30, 15%, 75%);
  transition: color 0.3s var(--ease);
  line-height: 1;
}

.star--active,
.star:hover {
  color: var(--gold);
}

/* ---------------------------------------------------------
   Side scroll-spy nav
   --------------------------------------------------------- */
.scroll-nav {
  position: fixed;
  left: 2rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 50;
  display: none;
}

.scroll-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.scroll-nav button {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: none;
  border: 0;
  padding: 0;
}

.scroll-nav .label {
  font-family: var(--serif);
  font-size: 1.05rem;
  color: var(--muted);
  transition: color 0.3s var(--ease);
}

.scroll-nav button:hover .label {
  color: var(--gold);
}

.scroll-nav li.is-active .label {
  color: var(--ink);
  font-style: italic;
}

.scroll-nav button:hover .star {
  color: var(--muted);
}

.scroll-nav li.is-active .star {
  color: var(--gold);
}

@media (min-width: 1024px) {
  .scroll-nav {
    display: block;
  }
}

/* ---------------------------------------------------------
   Hero
   --------------------------------------------------------- */
.hero {
  min-height: calc(100vh - var(--nav-h));
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 5rem 1rem;
}

.hero__inner {
  max-width: 72rem;
  margin: 0 auto;
}

.hero__title {
  font-family: var(--serif);
  font-weight: 400;
  color: var(--ink);
  letter-spacing: -0.02em;
  line-height: 1.12;
  font-size: clamp(2.1rem, 7.5vw, 6rem);
  margin: 0;
}

.hero__line {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
}

.hero__quote {
  opacity: 0.6;
}

.hero__accent {
  color: var(--gold);
  font-style: italic;
}

.hero__accent--plain {
  color: var(--gold);
}

.float-img {
  display: inline-block;
  overflow: hidden;
  vertical-align: middle;
  margin-inline: 0.25rem;
  box-shadow: 0 18px 40px -22px rgba(60, 40, 10, 0.45);
  animation: floaty var(--dur, 3s) ease-in-out infinite;
  animation-delay: var(--delay, 0s);
}

.float-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.float-img--lg {
  width: clamp(3.5rem, 9vw, 6rem);
  height: clamp(3.5rem, 9vw, 6rem);
  border-radius: 1rem;
}

.float-img--md {
  width: clamp(3rem, 7vw, 5rem);
  height: clamp(3rem, 7vw, 5rem);
  border-radius: 0.9rem;
}

.float-img--sm {
  width: clamp(2.75rem, 6vw, 4.5rem);
  height: clamp(2.75rem, 6vw, 4.5rem);
  border-radius: 0.75rem;
}

@keyframes floaty {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(var(--lift, -6px));
  }
}

.hero__meta {
  margin-top: 4rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 3rem;
}

/* Editorial link with gold underline reveal */
.ed-link {
  position: relative;
  display: inline-block;
}

.ed-link span:first-child {
  font-family: var(--serif);
  font-size: clamp(1.35rem, 3vw, 1.875rem);
  color: var(--muted);
  transition: color 0.3s var(--ease);
}

.ed-link span:last-child {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 2px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s var(--ease);
}

.ed-link:hover span:first-child {
  color: var(--gold);
}

.ed-link:hover span:last-child {
  transform: scaleX(1);
}

.ed-link--italic span:first-child {
  font-style: italic;
}

/* ---------------------------------------------------------
   Sections
   --------------------------------------------------------- */
.section {
  padding: 6rem 0;
  border-top: 1px solid var(--border);
}

.section--plain {
  border-top: 0;
}

.section__inner {
  max-width: 56rem;
  margin: 0 auto;
}

.section__title {
  font-family: var(--serif);
  font-weight: 400;
  color: var(--ink);
  letter-spacing: -0.02em;
  line-height: 1.1;
  font-size: clamp(2rem, 5.5vw, 3.5rem);
  margin: 0 0 3rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.section__title .accent {
  color: var(--gold);
  font-style: italic;
}

/* About */
.about-text {
  font-family: var(--serif);
  font-size: clamp(1.4rem, 4vw, 1.9rem);
  line-height: 1.5;
  color: var(--ink-body);
  margin: 0;
}

/* Skills */
.skill-group + .skill-group {
  margin-top: 3rem;
}

.skill-group__label {
  font-family: var(--sans);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  margin: 0 0 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.skill-group__list {
  font-family: var(--serif);
  font-size: clamp(1.4rem, 4vw, 1.875rem);
  line-height: 1.5;
  color: var(--ink-soft);
  margin: 0;
}

.skill-group__list .dot {
  color: var(--gold);
}

.skill-group__list em {
  font-style: italic;
}

/* Timeline (experience / education) */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 4rem;
}

.timeline__item {
  position: relative;
}

.timeline__row {
  display: flex;
  flex-direction: column;
}

.timeline__meta {
  flex-shrink: 0;
  margin-bottom: 1rem;
}

.timeline__meta-inner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.timeline__dates {
  font-family: var(--sans);
  font-size: 0.875rem;
  color: var(--muted);
  white-space: nowrap;
}

.timeline__role {
  font-family: var(--serif);
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  color: var(--ink);
  margin: 0 0 0.5rem;
}

.timeline__company {
  font-family: var(--serif);
  font-size: clamp(1.25rem, 3vw, 1.5rem);
  font-style: italic;
  color: var(--gold);
  margin: 0 0 1rem;
}

.timeline__desc {
  font-family: var(--sans);
  color: hsl(30, 10%, 40%);
  line-height: 1.7;
  margin: 0;
}

@media (min-width: 768px) {
  .timeline__row {
    flex-direction: row;
    gap: 3rem;
  }
  .timeline__meta {
    width: 12rem;
    margin-bottom: 0;
  }
  .timeline__item:not(:last-child)::before {
    content: "";
    position: absolute;
    left: 5px;
    top: 2rem;
    bottom: -4rem;
    width: 1px;
    background: hsl(30, 15%, 85%);
  }
}

/* Languages */
.languages {
  display: flex;
  flex-wrap: wrap;
  column-gap: 4rem;
  row-gap: 2rem;
}

.language {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.language__name {
  font-family: var(--serif);
  font-size: clamp(1.4rem, 3.5vw, 1.875rem);
  color: var(--ink);
}

.language__level {
  font-family: var(--serif);
  font-size: clamp(1.05rem, 2.5vw, 1.25rem);
  font-style: italic;
  color: var(--muted);
  margin-left: 0.5rem;
}

/* Contact CTA */
.cta {
  text-align: center;
}

.cta .section__title {
  justify-content: center;
  margin-bottom: 2rem;
}

.cta__stars {
  margin-top: 4rem;
  display: flex;
  justify-content: center;
  gap: 1rem;
  font-size: 1.25rem;
}

.cta__styleguide {
  display: inline-block;
  margin-top: 1rem;
  font-family: var(--sans);
  font-size: 0.75rem;
  color: var(--faint);
  transition: color 0.25s var(--ease);
}

.cta__styleguide:hover {
  color: var(--gold);
}

/* ---------------------------------------------------------
   Page headers
   --------------------------------------------------------- */
.page-head {
  padding: 4rem 0 2rem;
  text-align: center;
}

.page-head__title {
  font-family: var(--serif);
  font-weight: 400;
  color: var(--ink);
  letter-spacing: -0.02em;
  line-height: 1.1;
  font-size: clamp(2.5rem, 7vw, 4.5rem);
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.page-head__sub {
  margin: 1.5rem auto 0;
  max-width: 34rem;
  color: hsl(30, 10%, 40%);
  font-size: 1.125rem;
}

/* ---------------------------------------------------------
   Blog
   --------------------------------------------------------- */
.blog-list {
  max-width: 48rem;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 3rem;
  padding-bottom: 5rem;
}

.blog-card {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  align-items: flex-start;
}

.blog-card__body {
  flex: 1;
}

.blog-card__meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.875rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.blog-card__meta .star {
  color: var(--gold);
}

.blog-card__title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.5rem, 4vw, 1.875rem);
  color: var(--ink);
  margin: 0;
  transition: color 0.25s var(--ease);
}

.blog-card:hover .blog-card__title {
  color: var(--gold-dark);
}

.blog-card__excerpt {
  margin: 0.75rem 0 0;
  color: hsl(30, 10%, 40%);
  line-height: 1.7;
}

.blog-card__more {
  display: inline-block;
  margin-top: 1rem;
  font-size: 0.875rem;
  letter-spacing: 0.03em;
  color: var(--gold-dark);
}

.blog-card__thumb {
  width: 100%;
  height: 11rem;
  border-radius: 0.75rem;
  overflow: hidden;
  flex-shrink: 0;
  order: -1;
}

.blog-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--ease);
}

.blog-card:hover .blog-card__thumb img {
  transform: scale(1.05);
}

@media (min-width: 768px) {
  .blog-card {
    flex-direction: row;
  }
  .blog-card__thumb {
    width: 12rem;
    order: 2;
  }
}

/* ---------------------------------------------------------
   Blog post
   --------------------------------------------------------- */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--sans);
  font-size: 0.875rem;
  margin-bottom: 2rem;
}

.breadcrumb a {
  color: var(--muted);
  transition: color 0.25s var(--ease);
}

.breadcrumb a:hover {
  color: var(--gold);
}

.breadcrumb .sep {
  color: var(--gold);
}

.breadcrumb .current {
  color: var(--ink-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 200px;
}

.post-head {
  max-width: 48rem;
  margin: 0 auto;
}

.post-head__meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.875rem;
  color: var(--muted);
  margin-bottom: 1rem;
}

.post-head__meta .star {
  color: var(--gold);
}

.post-head__title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2rem, 5.5vw, 3.75rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0;
}

.post-author {
  margin-top: 2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.post-author__avatar {
  width: 3rem;
  height: 3rem;
  border-radius: 999px;
  overflow: hidden;
  animation: floaty 3s ease-in-out infinite;
}

.post-author__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.post-author__name {
  margin: 0;
  font-weight: 500;
  color: var(--ink);
}

.post-author__role {
  margin: 0;
  font-size: 0.875rem;
  color: var(--muted);
}

.post-hero {
  max-width: 64rem;
  margin: 2.5rem auto;
  height: clamp(16rem, 40vw, 24rem);
  border-radius: 1rem;
  overflow: hidden;
}

.post-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.post-body {
  max-width: 42rem;
  margin: 0 auto;
  padding: 3rem 0;
}

.post-body p {
  font-family: var(--sans);
  color: var(--ink-soft);
  line-height: 1.8;
  font-size: 1.0625rem;
  margin: 0 0 1.5rem;
}

.post-body .end-mark {
  text-align: center;
  color: var(--gold);
  margin-top: 3rem;
}

/* Comments */
.comments {
  max-width: 42rem;
  margin: 0 auto 5rem;
  border-top: 1px solid hsl(30, 15%, 85%);
  padding-top: 3rem;
}

.comments__title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.5rem;
  color: var(--ink);
  margin: 0;
}

.comment {
  background: var(--card);
  border-radius: 0.75rem;
  padding: 1.5rem;
  margin-top: 2rem;
}

.comment__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.comment__author {
  font-weight: 500;
  color: var(--ink);
}

.comment__date {
  font-size: 0.875rem;
  color: var(--muted);
}

.comment__content {
  margin: 0;
  color: var(--ink-body);
  line-height: 1.7;
}

/* ---------------------------------------------------------
   Forms
   --------------------------------------------------------- */
.form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  text-align: left;
}

.form--narrow {
  max-width: 34rem;
  margin: 0 auto;
}

.field label {
  display: block;
  font-family: var(--sans);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: hsl(30, 10%, 40%);
  margin-bottom: 0.5rem;
}

.field input,
.field textarea {
  width: 100%;
  background: transparent;
  border: 0;
  border-bottom: 2px solid var(--border-strong);
  padding: 0.75rem 0;
  font-family: var(--serif);
  font-size: 1.25rem;
  color: var(--ink);
  outline: none;
  transition: border-color 0.25s var(--ease);
  resize: none;
}

.field input::placeholder,
.field textarea::placeholder {
  color: var(--faint);
}

.field input:focus,
.field textarea:focus {
  border-color: var(--gold);
}

.form__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 640px) {
  .form__grid {
    grid-template-columns: 1fr 1fr;
  }
}

.btn-primary {
  border: 0;
  border-radius: 999px;
  padding: 1rem 2rem;
  background: var(--ink);
  color: var(--bg);
  font-family: var(--sans);
  font-size: 0.875rem;
  letter-spacing: 0.04em;
  transition: background 0.25s var(--ease), transform 0.2s var(--ease),
    opacity 0.2s;
}

.btn-primary:hover {
  background: hsl(30, 10%, 25%);
  transform: scale(1.02);
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-block {
  width: 100%;
  margin-top: 1rem;
}

/* Contact details */
.contact-details {
  margin-top: 4rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2rem;
  font-size: 0.875rem;
  color: hsl(30, 10%, 40%);
}

.contact-details .k {
  display: block;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.75rem;
  opacity: 0.6;
}

.contact-details .v {
  margin-top: 0.25rem;
}

/* ---------------------------------------------------------
   Toast
   --------------------------------------------------------- */
.toast-stack {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  min-width: 16rem;
  max-width: 22rem;
  background: var(--ink);
  color: var(--bg);
  border-radius: 0.75rem;
  padding: 0.9rem 1.1rem;
  box-shadow: 0 18px 40px -20px rgba(0, 0, 0, 0.6);
  transform: translateY(8px);
  opacity: 0;
  animation: toast-in 0.35s var(--ease) forwards;
}

.toast--destructive {
  background: hsl(0, 55%, 40%);
}

.toast__title {
  font-size: 0.9rem;
  font-weight: 500;
}

.toast__desc {
  font-size: 0.8rem;
  opacity: 0.8;
  margin-top: 0.15rem;
}

.toast.is-leaving {
  animation: toast-out 0.3s var(--ease) forwards;
}

@keyframes toast-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateY(8px);
  }
}

/* ---------------------------------------------------------
   Style guide helpers
   --------------------------------------------------------- */
.swatch-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

@media (min-width: 768px) {
  .swatch-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.swatch {
  border-radius: 0.75rem;
  padding: 1rem;
  height: 7rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.swatch__name {
  font-size: 0.875rem;
  font-weight: 500;
}

.swatch__code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.75rem;
  opacity: 0.8;
}

.guide-block {
  margin-bottom: 5rem;
}

.guide-block > h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.875rem;
  color: var(--ink);
  margin: 0 0 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid hsl(30, 15%, 85%);
}

/* ---------------------------------------------------------
   Reveal animation
   --------------------------------------------------------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
  transition-delay: var(--reveal-delay, 0s);
}

[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  [data-reveal] {
    opacity: 1;
    transform: none;
  }
}
