/* =========================================================
   TimberPath style.css
   Shared tokens, base rules and reusable card components.
   ========================================================= */

/* =========================================================
   00. Design tokens
   ========================================================= */

:root {
    --tp-text: #111111;
    --tp-accent: #c9a46b;
    --tp-header-height: 96px;
    --tp-menu-brush: url("/assets/images/ui/menu-brush.png");
    --tp-overlay: rgba(7, 7, 7, 0.78);
    --tp-ease: cubic-bezier(0.22, 1, 0.36, 1);

    --about-accent: #c9a46b;
    --about-heading: #1f1f1b;
    --about-heading-dark: #161512;
    --about-text: #656565;
    --about-meta: #8c867d;
    --about-border: #e3e0d9;
    --about-surface: #f8f6f2;
    --about-surface-3: #fbfaf8;
    --about-white: #ffffff;

    --tp-post-title: #2a2723;
    --tp-post-title-underline: #3a342e;
    --tp-post-meta: #8c867d;
    --tp-post-link-focus: #c9a46b;
    --tp-post-excerpt: #656565;
    --tp-post-excerpt-size: 16px;
    --tp-post-excerpt-line-height: 135%;
    --tp-post-category-brush-image: url("/assets/images/ui/category-brush.svg");
}

/* =========================================================
   01. Base
   ========================================================= */

html {
    box-sizing: border-box;
    scroll-behavior: smooth;
}

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

body {
    margin: 0;
    overflow-x: hidden;
}

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

button,
input,
textarea,
select {
    font: inherit;
}

.container {
    width: min(100%, 1327px);
    margin: 0 auto;
    padding: 0 12px;
}

#guides,
#about,
#faq,
#terms {
    scroll-margin-top: calc(var(--tp-header-height) + 24px);
}

/* =========================================================
   02. Shared TimberPath card primitives
   ========================================================= */

.tp-card {
    position: relative;
    min-width: 0;
}

.tp-card__link {
    display: block;
    color: inherit;
    text-decoration: none;
}

.tp-card__link:focus-visible {
    outline: 2px solid var(--tp-accent);
    outline-offset: 4px;
}

.tp-card__title {
    margin: 0;
    text-wrap: balance;
}

.tp-card__title-text {
    display: inline;
    background-repeat: no-repeat;
    background-size: 0 var(--tp-underline-height, 2px);
    background-position: 0 var(--tp-underline-position, 100%);
    transition: background-size 0.32s ease;
}

.tp-card__link:hover .tp-card__title-text,
.tp-card__link:focus-visible .tp-card__title-text {
    background-size: 100% var(--tp-underline-height, 2px);
}

.tp-card__meta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: fit-content;
    margin: 0;
}

.tp-card__meta-text {
    display: inline-block;
}

.tp-card__meta-icon {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    background-color: currentColor;
    mask-repeat: no-repeat;
    -webkit-mask-repeat: no-repeat;
    mask-position: center;
    -webkit-mask-position: center;
    mask-size: contain;
    -webkit-mask-size: contain;
}

.tp-card__meta-icon--date {
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M19 4h-1V2h-2v2H8V2H6v2H5a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2Zm0 15H5V10h14v9Zm0-11H5V6h14v2Z'/%3E%3C/svg%3E");
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M19 4h-1V2h-2v2H8V2H6v2H5a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2Zm0 15H5V10h14v9Zm0-11H5V6h14v2Z'/%3E%3C/svg%3E");
}

.tp-card__media-shell {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    background: #d8d5cf;
}

.tp-card__media-tilt {
    position: absolute;
    top: -7%;
    left: -7%;
    width: 114%;
    height: 114%;
    transform: perspective(1200px) rotateX(0deg) rotateY(0deg) scale(1.02);
    transform-style: preserve-3d;
    will-change: transform;
    transition: transform 0.18s ease-out;
}

.tp-card__image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    user-select: none;
    -webkit-user-drag: none;
    backface-visibility: hidden;
}

/* =========================================================
   03. Post cards
   ========================================================= */

.tp-card--post {
    --tp-underline-height: 2px;
    --tp-underline-position: 93%;
    position: relative;
    width: 415px;
    flex: 0 0 415px;
    min-width: 0;
    margin-bottom: 30px;
}

.tp-card--post .tp-card__link:focus-visible {
    outline-color: var(--tp-post-link-focus);
}

.tp-card--post .tp-card__media-shell {
    width: 415px;
    height: 493px;
    margin-bottom: 34px;
    overflow: visible;
    background: transparent;
}

.tp-card--post .tp-card__media-tilt {
    inset: 0;
    top: auto;
    left: auto;
    width: 100%;
    height: 100%;
}

.tp-card--post .tp-card__category {
    position: absolute;
    top: 20px;
    left: 10px;
    z-index: 5;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 128px;
    min-height: 28px;
    padding: 0 14px 0 12px;
    color: var(--tp-post-meta);
    font-family: "Merriweather", serif;
    font-size: 15px;
    font-style: italic;
    line-height: 1;
    white-space: nowrap;
    text-align: center;
    pointer-events: none;
    isolation: isolate;
    background: transparent;
}

.tp-card--post .tp-card__category::before {
    content: "";
    position: relative;
    z-index: 2;
    width: 19px;
    height: 19px;
    flex: 0 0 19px;
    background-color: currentColor;
    mask-repeat: no-repeat;
    -webkit-mask-repeat: no-repeat;
    mask-position: center;
    -webkit-mask-position: center;
    mask-size: contain;
    -webkit-mask-size: contain;
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' fill-rule='evenodd' d='M20 3h-6.17c-.53 0-1.04.21-1.41.59l-9.83 9.83a2 2 0 0 0 0 2.83l5.17 5.17a2 2 0 0 0 2.83 0l9.83-9.83A2 2 0 0 0 21 10.17V4a1 1 0 0 0-1-1Zm-6.17 2H19v5.17L9.17 20 4 14.83 13.83 5ZM16.5 7.25a1.25 1.25 0 1 1 0 2.5 1.25 1.25 0 0 1 0-2.5Z' clip-rule='evenodd'/%3E%3C/svg%3E");
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' fill-rule='evenodd' d='M20 3h-6.17c-.53 0-1.04.21-1.41.59l-9.83 9.83a2 2 0 0 0 0 2.83l5.17 5.17a2 2 0 0 0 2.83 0l9.83-9.83A2 2 0 0 0 21 10.17V4a1 1 0 0 0-1-1Zm-6.17 2H19v5.17L9.17 20 4 14.83 13.83 5ZM16.5 7.25a1.25 1.25 0 1 1 0 2.5 1.25 1.25 0 0 1 0-2.5Z' clip-rule='evenodd'/%3E%3C/svg%3E");
}

.tp-card--post .tp-card__category::after {
    content: "";
    position: absolute;
    inset: -9px -18px -10px -12px;
    z-index: -1;
    background-image: var(--tp-post-category-brush-image);
    background-repeat: no-repeat;
    background-position: center;
    background-size: 100% 100%;
    pointer-events: none;
}

.tp-card--post .tp-card__body {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.tp-card--post .tp-card__date {
    margin: 0;
    color: var(--tp-post-meta);
    font-family: "Merriweather", serif;
    font-size: 15px;
    font-style: italic;
}

.tp-card--post .tp-card__title {
    color: var(--tp-post-title);
    font-family: "Anton", sans-serif;
    font-size: 30px;
    font-weight: 400;
    line-height: 125%;
    letter-spacing: 0.01em;
    text-transform: uppercase;
}

.tp-card--post .tp-card__title-text {
    background-image: linear-gradient(var(--tp-post-title-underline), var(--tp-post-title-underline));
    background-position: 0 var(--tp-underline-position);
    background-size: 0 var(--tp-underline-height);
}

.tp-card--post .tp-card__link:hover .tp-card__title-text,
.tp-card--post .tp-card__link:focus-visible .tp-card__title-text {
    background-size: 100% var(--tp-underline-height);
}

.tp-card--post .tp-card__excerpt {
    margin: 0;
    color: var(--tp-post-excerpt);
    font-family: "Inter", sans-serif;
    font-size: var(--tp-post-excerpt-size);
    line-height: var(--tp-post-excerpt-line-height);
}

@media (max-width: 1200px) {
    .tp-card--post {
        width: 320px;
        flex-basis: 320px;
    }

    .tp-card--post .tp-card__media-shell {
        width: 320px;
        height: 380px;
        margin-bottom: 30px;
    }

    .tp-card--post .tp-card__title {
        font-size: 24px;
    }

    .tp-card--post .tp-card__excerpt {
        font-size: 16px;
    }

    .tp-card--post .tp-card__category {
        top: 12px;
        left: 10px;
        padding: 5px 14px 6px 10px;
        font-size: 14px;
    }

    .tp-card--post .tp-card__category::before {
        width: 13px;
        height: 13px;
        flex-basis: 13px;
    }
}

@media (max-width: 640px) {
    .tp-card--post {
        width: 100%;
        flex-basis: 100%;
    }

    .tp-card--post .tp-card__media-shell {
        width: 100%;
        height: auto;
        aspect-ratio: 0.84 / 1;
        margin-bottom: 26px;
    }

    .tp-card--post .tp-card__media-tilt,
    .tp-card--post .tp-card__image {
        width: 100%;
        height: 100%;
    }

    .tp-card--post .tp-card__category {
        top: 12px;
        left: 10px;
    }
}

/* =========================================================
   04. Header
   ========================================================= */

.tp-header {
    position: relative;
    z-index: 60;
    width: 100%;
    margin: 0;
    padding: 0;
    background: transparent;
    border: 0;
    overflow: visible;
}

.tp-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    width: 100%;
    min-height: var(--tp-header-height);
    margin: 0;
    padding: 14px clamp(24px, 3.5vw, 56px);
}

.tp-header__brand {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    color: inherit;
    text-decoration: none;
    line-height: 0;
}

.tp-header__brand img {
    display: block;
    width: auto;
    max-width: 155px;
    height: auto;
    object-fit: contain;
}

.tp-nav {
    min-width: 0;
    margin-left: auto;
}

.tp-nav__close {
    display: none;
}

.tp-nav__list {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: nowrap;
    gap: clamp(18px, 1.5vw, 30px);
    margin: 0;
    padding: 0;
    list-style: none;
}

.tp-nav__item {
    margin: 0;
    padding: 0;
    list-style: none;
}

.tp-nav__link {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 14px;
    color: var(--tp-text);
    text-decoration: none;
    text-transform: uppercase;
    font-family: "Anton", sans-serif;
    font-size: clamp(0.98rem, 0.95vw, 1.08rem);
    line-height: 1;
    letter-spacing: 0.035em;
    white-space: nowrap;
    isolation: isolate;
    transition: color 0.2s ease;
}

.tp-nav__link::before {
    content: "";
    position: absolute;
    top: 50%;
    left: -10px;
    right: -10px;
    z-index: -1;
    height: 30px;
    background-image: var(--tp-menu-brush);
    background-repeat: no-repeat;
    background-position: center;
    background-size: 100% 100%;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-50%) scale(0.96);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.tp-nav__link:hover,
.tp-nav__link:focus-visible,
.tp-nav__link.is-current,
.tp-nav__link[aria-current="page"] {
    color: #ffffff;
}

.tp-nav__link:hover::before,
.tp-nav__link:focus-visible::before,
.tp-nav__link.is-current::before,
.tp-nav__link[aria-current="page"]::before {
    opacity: 1;
    transform: translateY(-50%) scale(1);
}

.tp-header__toggle {
    position: relative;
    z-index: 2;
    display: none;
    flex: 0 0 auto;
    width: 54px;
    height: 54px;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--tp-text);
    cursor: pointer;
}

.tp-header__toggle-line {
    position: absolute;
    right: 0;
    height: 3px;
    background: currentColor;
    transition: transform 0.22s ease, width 0.22s ease;
}

.tp-header__toggle-line--top {
    top: 13px;
    width: 31px;
}

.tp-header__toggle-line--middle {
    top: 20px;
    width: 24px;
}

.tp-header__toggle-line--bottom {
    top: 27px;
    width: 31px;
}

.tp-header__toggle:hover .tp-header__toggle-line--middle,
.tp-header__toggle:focus-visible .tp-header__toggle-line--middle {
    transform: translateX(-8px);
}

.tp-header__toggle[aria-expanded="true"] .tp-header__toggle-line--middle {
    transform: translateX(0);
}

@media (max-width: 1024px) {
    .tp-header__inner {
        min-height: 88px;
    }

    .tp-header__brand img {
        width: 140px;
    }

    .tp-header__toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        margin-left: auto;
    }

    .tp-nav {
        position: fixed;
        inset: 0;
        z-index: 2000;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 96px 20px 34px;
        background: var(--tp-overlay);
        backdrop-filter: blur(12px);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity 0.22s ease, visibility 0.22s ease;
    }

    .tp-nav__close {
        position: absolute;
        top: 18px;
        right: 18px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 52px;
        height: 52px;
        margin: 0;
        padding: 0;
        border: 0;
        background: transparent;
        color: #ffffff;
        cursor: pointer;
    }

    .tp-nav__close span {
        position: absolute;
        top: 50%;
        left: 50%;
        width: 24px;
        height: 2px;
        background: currentColor;
    }

    .tp-nav__close span:first-child {
        transform: translate(-50%, -50%) rotate(45deg);
    }

    .tp-nav__close span:last-child {
        transform: translate(-50%, -50%) rotate(-45deg);
    }

    .tp-nav__list {
        width: 100%;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 16px;
        opacity: 0;
        transform: translateY(10px) scale(0.985);
        transition: transform 0.24s var(--tp-ease), opacity 0.18s ease;
    }

    .tp-nav__link {
        min-height: 58px;
        padding: 0 18px;
        color: #ffffff;
        font-size: clamp(1.55rem, 6vw, 2.3rem);
        letter-spacing: 0.035em;
    }

    .tp-nav__link::before {
        left: -12px;
        right: -12px;
        height: 36px;
    }

    body.tp-menu-open .tp-nav {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    body.tp-menu-open .tp-nav__list {
        opacity: 1;
        transform: translateY(0) scale(1);
    }

    body.tp-menu-open {
        overflow: hidden;
    }
}

@media (min-width: 1025px) {
    .tp-nav {
        position: static;
        padding: 0;
        background: transparent;
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
    }
}

@media (max-width: 640px) {
    :root {
        --tp-header-height: 78px;
    }

    .tp-header__inner {
        padding-inline: 16px;
    }

    .tp-header__brand img {
        width: 120px;
    }

    .tp-nav {
        padding-top: 84px;
    }

    .tp-nav__link {
        font-size: clamp(1.45rem, 8vw, 2rem);
    }
}

/* =========================================================
   05. Footer
   ========================================================= */

.tp-footer {
    padding: 40px 0 90px;
    overflow: hidden;
}

.tp-footer__inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.tp-footer__brand {
    display: inline-flex;
    justify-content: center;
    margin-bottom: 36px;
    color: inherit;
    text-decoration: none;
}

.tp-footer__logo {
    display: block;
    width: 250px;
    height: auto;
}

.tp-footer__description {
    max-width: 500px;
    margin: 0 0 54px;
    color: #8f8b86;
    font-family: "Merriweather", serif;
    font-size: 18px;
    font-style: italic;
    font-weight: 400;
    line-height: 1.55;
    letter-spacing: 0.01em;
    text-wrap: balance;
}

.tp-footer__nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    column-gap: 56px;
    row-gap: 16px;
}

.tp-footer__link {
    display: inline-block;
    color: #171717;
    text-decoration: none;
    text-transform: uppercase;
    font-family: "Oswald", sans-serif;
    font-size: clamp(0.98rem, 0.95vw, 1.08rem);
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.01em;
    transition: color 0.22s ease;
}

.tp-footer__link:hover,
.tp-footer__link:focus-visible,
.tp-footer__link--active {
    color: var(--tp-accent);
}

.tp-footer__link:focus-visible {
    outline: none;
}

@media (max-width: 991px) {
    .tp-footer {
        padding: 72px 0 46px;
    }

    .tp-footer__brand {
        margin-bottom: 30px;
    }

    .tp-footer__logo {
        width: min(100%, 260px);
    }

    .tp-footer__description {
        max-width: 700px;
        margin-bottom: 42px;
        font-size: clamp(1rem, 1.9vw, 1.25rem);
    }

    .tp-footer__nav {
        column-gap: 34px;
        row-gap: 14px;
    }
}

@media (max-width: 640px) {
    .tp-footer {
        padding: 54px 0 38px;
    }

    .tp-footer__brand {
        margin-bottom: 24px;
    }

    .tp-footer__logo {
        width: min(100%, 210px);
    }

    .tp-footer__description {
        max-width: 100%;
        margin-bottom: 34px;
        padding-inline: 8px;
        font-size: 0.98rem;
        line-height: 1.6;
    }

    .tp-footer__nav {
        display: grid;
        grid-template-columns: repeat(2, minmax(90px, auto));
        justify-content: center;
        column-gap: 22px;
        row-gap: 14px;
    }

    .tp-footer__link {
        text-align: center;
    }
}

@media (max-width: 420px) {
    .tp-footer__logo {
        width: min(100%, 185px);
    }

    .tp-footer__description {
        font-size: 0.94rem;
    }

    .tp-footer__nav {
        grid-template-columns: 1fr;
        row-gap: 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .tp-header__toggle-line,
    .tp-nav,
    .tp-nav__list,
    .tp-nav__link,
    .tp-nav__link::before,
    .tp-footer__link {
        transition: none;
    }
}
